Рет қаралды 6,674
MATLAB - To read from a file in MATLAB, first open the file with fopen.
If fopen returns a -1, there was an error opening the file.
fgetl - read in a line at a time from the MATLAB file, does not keep the newline character
fgets - read in a line at a time from the MATLABE file, KEEP the newline character.
If you want to read data in as a data type other than a string, you can use
fscanf - read from a file, you can include format specifiers like %d (integers), %f (floating point numbers), %c (characters), %s (strings)