reading files and data into matlab
2 ビュー (過去 30 日間)
古いコメントを表示
Hi,
I'm very new to matlab coding and I hope that you guys can help me with this simple matlab code. I'm having trouble in reading some files from different directories. The following screen shot shows the location of the files that I want to read.
In processor1 directory, there are files for each time step. I need to read all the files in those directories except directory 0 and constant which has to be skipped. And then the files for each variable e.g. alpha1 should be imported and finally I want to sort them in ascending order.
I have tried the following but it only gives the name of the foldes at each time step. How to I enter the subfolder and read the files?
I really appreciate any ideas.
2 件のコメント
回答 (3 件)
Hale
2013 年 7 月 17 日
1 件のコメント
Jan
2013 年 7 月 18 日
Please do not post questions in the section for answers. Adding the source code as formatted code is much better than adding a picture, because we can copy&paste the code to suggest improvements.
When you omit the brute clearing header containing the "clear all", you could use the debugger to check, what's going on in your code. Set a break point in the first line, step through the code line by line and check the value of the local variables. But unfortunately the frequently occurring "clear all" deletes all break points. Ugly. So remove it.
参考
カテゴリ
Help Center および File Exchange で Startup and Shutdown についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!