Member of the support class.
c = fwrite(fid, a)
c = fwrite(fid, a, type)
c = fwrite(fid, a, type, s)
Writes binary data to a file.
| Name | Description | ||||||||||||||||||||||||||||
| fid | Specifies the identifier for the file to which you want to write. Use the fopen function to open a file and assign it an identifier. fid is an integer. | ||||||||||||||||||||||||||||
| a | Specifies the data you want to write to the file specified by fid. a is a vector or matrix. | ||||||||||||||||||||||||||||
| type | Specifies the data type of a that you want to write to the file specified by fid. If you specify s, you can add a positive integer of the form 'm*' before type. LabVIEW then skips s bytes before each m bytes it writes to the file. type is a string that accepts the following values.
|
||||||||||||||||||||||||||||
| s | Specifies the number of bytes to skip before each m bytes as you specify in type. s is a positive integer. |
| Name | Description |
| c | Returns the amount of data that LabVIEW wrote successfully to the file specified by fid. c is a positive integer. |
fid = fopen('test.dat', 'w');
a = [-0.1, 0, 0.1; -0.2, 0.1, 0.4];
c = fwrite(fid, a, '4*float32', 2);
fclose(fid);