开发者

How can I read vectors from text files to MATLAB?

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜