Note that file_name is a very misleading name for that variable: the output of fopen is not a name, but is a kind of handle or ID to the opened file. Most MATLAB users call that variable fid.
Using fscanf to make a matrix from text file?


1 commentaire
Réponses (1)
2 commentaires
"So if I wanted to change the format of an individual column, would i have to separate it into a column vector, and then change the format of that vector?"
No, because you cannot "change the format of that vector": numeric vectors do not contain any formatting information whatsoever, so you cannot change what does not exist. Formatting is a feature of the command window, and solely affects how data is displayed. If you want to display particular data with a particular format, then change the format: any data displayed after that will use that format, until you change it again.
Changing the format is not the only way to control how data looks like: if you want more control then you will need to write your own displaying routine using fprintf.
Voir également
Catégories
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!