I have 20 text fi开发者_StackOverflow中文版les each containing a vector of size 180. How can I access each text file and assign the vector to a variable?
If you want to do it manually use Import Data
under File
(or use uiimport
).
If you want to automate it use fid = fopen(filename)
and then use var = textscan(fid, 'format')
where format depends on how your vectors are structured. Spend some time reading doc textscan
and doc fopen
everything you probably need to know is in those two files. If your data is nicely structured look at doc importdata
.
精彩评论