Read an array from a file according to a given size and format.
(data, count)=fscanf(fi, form, vsize)
| The reference to a file that has been opened for input.|
| The format string.|
| A two-element vector specifying the number of rows and columns to be read. See below for more details.
| The array read from the file according to the specified format and size.|
If the number of rows specified in
vsize ) is
the elements are
read till the end of file has been reached and they are stored in a vector.
If the last input is of the form
[m inf] the elements are
read till the end of file has been reached and they are stored in a matrix
m rows and as many columns as are necessary to store all the input elements.
0.8937 0.0341 0.4218 0.9620
0.7450 0.4891 0.7446 0.2077
0.6824 0.6347 0.8586 0.8898
>> // Note that the array is output column by column.
>>fprintf(fi,"%12.4f %12.8f %20.16f \n",a)
0.8937 0.74495452 0.6824312135948638
0.0341 0.48906726 0.6347462685793776
0.4218 0.74458489 0.8586068483123598
0.9620 0.20765775 0.8897757460594888