Member of the support class.
c = fprintf(format, a)
c = fprintf(fid, format, a)
Formats data as text and writes the text to a file.
| 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. |
| Name | Description |
| c | Returns the amount of data that LabVIEW writes successfully to the file specified by fid. c is a positive integer. |
This function is not supported in the LabVIEW Run-Time Engine. Do not use this function in a stand-alone application or shared library.
t = 0:0.1:pi;
x = sin(t);
fid = fopen('test.dat', 'w');
c = fprintf(fid, '%f\n', x);
fclose(fid);