MATLAB - fgetl and fgets for reading a line of text

preview_player
Показать описание
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)
Рекомендации по теме
Комментарии
Автор

These videos are truly stellar! Information is delivered at a digestible rate without making the videos far too long. Thank you for helping me with my Master's Thesis in coastal engineering!

camdendean
Автор

How can i take the second row with fgetl?

sindivcx
Автор

Thanks for the video. What is the code in purple? I don't understand what it is.

MyMpc