Owning Class: support
Requires: MathScript RT Module
a = fscanf(fid, format)
a = fscanf(fid, format, size)
[a, b] = fscanf(fid, format)
[a, b] = fscanf(fid, format, size)
Reads text in a file and converts the text to an appropriate data type.
| Name | Description |
|---|---|
| fid | Specifies the identifier for the file you want to read. Use the fopen function to open a file and assign it an identifier. fid is an integer. |
| format | Specifies the format in which to read text from the file. format must use the appropriate format specifier syntax. format is a string. |
| size | Specifies the amount of text to read from the file. LabVIEW discards all but the first two elements of size. If size is inf, LabVIEW reads from the file using the specified format until all the text is read or an error occurs. size is a scalar or a vector. |
| Name | Description |
|---|---|
| a | Returns the text that LabVIEW reads from the file specified by fid. a is a vector or matrix of doubles or characters. |
| b | Returns the amount of text that LabVIEW reads successfully from the file specified by fid. b is a positive integer. |
fid = fopen('test.dat', 'r');
[a, b] = fscanf(fid, '%[a-z] %*d %f', 10);
fclose(fid);