How can I load variable data from some MATFfile into table?
이전 댓글 표시
Hello I'm beginner.
I have 20 MATfiles with different names, I want to load some data from 10 MATfile only into table. For example, in a MATfile there are variables :
date, month, year, tkp, tpp, etc...
And I want to load data date, month, year only from just 10 MATfile into table :
| No | Date | Month | Year |
| 1 | 01 | February | 2013 |
| 2 | 21 | Februari | 2013 |
............................
| 10 | 29 | Februari | 2013|
Please help me.
답변 (1개)
Chandrasekhar
2013년 6월 30일
0 개 추천
matFiles = dir('*.mat'); table = []; for i = 1:length(matFiles) eval('load(matFiles(i))'); table{i,1} = num2str(i); table{i,2} = num2str(date); table{i,3} = month; table{i,4} = num2str(year); end
댓글 수: 6
Indri Djon Hansemit
2013년 6월 30일
Chandrasekhar
2013년 6월 30일
could you please give me information about your mat file like matfile name and data in matfile
Chandrasekhar
2013년 6월 30일
remove the command
eval('load(matFiles(i))');
and use
str = matFiles(I).name; load(str);
I think this should work
Indri Djon Hansemit
2013년 6월 30일
Indri Djon Hansemit
2013년 6월 30일
Chandrasekhar
2013년 6월 30일
i'm unable to guess how your data looks like.. can u send me the screen shot of the data. or send mat file to me if possible. I can give the solution
카테고리
도움말 센터 및 File Exchange에서 Workspace Variables and MAT Files에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!