开发者

How can I read vectors from text files to MATLAB?

开发者 https://www.devze.com 2023-02-09 09:39 出处:网络
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 u

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

精彩评论

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