help with a simple error
情報
この質問は閉じられています。 編集または回答するには再度開いてください。
古いコメントを表示
Hello there,
I was hoping that somebody could perhaps help me out with a problem that I have. I'm only learning how to use matlab.
I have 100 4x4 matrices in .txt files in a folder. The file names are matrix1.txt, matrix2.txt.....matrix100.txt.
I'm trying to import them all using
C = cell(100,1);
for ii = 1:100
C{ii} = importdata(['matrix' num2str(ii) '.txt']) ;
end
but I'm getting an error
??? Error using ==> importdata at 123
Unable to open file.
would anybody know why?
Sincere thanks
0 件のコメント
回答 (1 件)
Wayne King
2012 年 2 月 19 日
0 投票
Are these files matrix1.txt, matrix2.txt, etc. located in a folder which is on the MATLAB path?
Use addpath, or pathtool, to add that folder to the MATLAB search path.
3 件のコメント
John
2012 年 2 月 19 日
Wayne King
2012 年 2 月 19 日
Hi John, are these just numeric matrices with no text in them?
are you sure that matrix1.txt all the way to matrix100.txt exists in that folder
John
2012 年 2 月 19 日
この質問は閉じられています。
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!