i want to read text file but i want to start from 5 row to 230. In Addition i want to read Parameters till semicolon. Do you have any opinion?
Best Answer
Read
doc textscan
and the examples, carefully. There are sufficient examples and info there...
You seem to have mixed 'column' and 'row' in your description of what you want/don't want; I'll presume it's only the 5:230 rows to read(*) and all the columns...
(*) Altho I used the option COUNT value above, unless the file is extremely large it's often faster to simply read the whole file and then just delete the portions of the data that are not of interest. This is so because for the whole file the i/o system can make maximum use of buffering and all as opposed to having to count records and return only that subsection required so may be sufficient overhead saved in the i/o processing to make up for the added amount data.
The best alternatives are to keep your data in an array (e.g. as they are returned from your file-reading function), or if you require key-value access to your data then use astructure . Structures do allowdynamic fieldnames , and this is much more robust than dynamic variables.
If you have a newer version of matlab you can also use atable , which stores the data together in one array but also allows key-name access to the columns.
Summary: use a structure or table to store your data.
Best Answer