Company Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI

fprintf (MathScript Function) (Windows, Not in Base Package)

LabVIEW 8.5 Help
August 2007

NI Part Number:
371361D-01

»View Product Info

Member of the support class.

Syntax

c = fprintf(format, a)

c = fprintf(fid, format, a)

Description

Formats data as text and writes the text to a file.

Details

Examples

Inputs

Name Description
fid Specifies the identifier for the file you want to write. Use the fopen function to open a file and assign it an identifier. fid is an integer. If you do not specify fid, fprintf formats data as text and displays the context of this text.
format Specifies the format in which to write text to the file. format must use the appropriate format specifier syntax. format is a string.
a Specifies the data you want to write to the file specified by fid. a is a vector or matrix.

Outputs

Name Description
c Returns the amount of data that LabVIEW writes successfully to the file specified by fid. c is a positive integer.

Details

This function is not supported in the LabVIEW Run-Time Engine. Do not use this function in a stand-alone application or shared library.

Examples

t = 0:0.1:pi;
x = sin(t);
fid = fopen('test.dat', 'w');
c = fprintf(fid, '%f\n', x);
fclose(fid);

Related Topics

fclose
fopen
fwrite
fscanf
fseek
textread


Resources


 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit