How to export variables in mat file to excel?
古いコメントを表示
I have a lot of data to deal with. I have saved different variables in a structure data. for example:
HistStruct:
velocity < 12441x1 double >
median 0.1449
mean 0.1552
and I save them into mat file. I have nearly 100 HistStruct.mat files. Now I want to calculate the average value of each of them. But I dont know how to export them from variables edit. Can anyone help me? Thank you very much.
3 件のコメント
Azzi Abdelmalek
2013 年 12 月 19 日
編集済み: Azzi Abdelmalek
2013 年 12 月 19 日
This is not clear, what are the names of your mat files? What average you want to caculate?
Yuqing
2013 年 12 月 19 日
Amit
2013 年 12 月 20 日
First - are all the files are named Histstruct.mat? It they are, they must be stored in different folders? Unless there is some structure in storage of these files, I dont see how you can get away from manually loading each file. The idea would be creating a matrix (lets call A) (if you preallocate the matrix, that would be better). After loading first Histstruct.mat, do something like
A(1:numel(Histstruct.velocity)) = Histstruct.velocity;
After the first time and loading more Histstruct.mat do this;
A(end+1:end+numel(Histstruct.velocity)) = Histstruct.velocity;
And In the end, simple mean command on A will give you the results.
採用された回答
その他の回答 (1 件)
Amit
2013 年 12 月 19 日
I think you are trying to get average value for velocity. If that's correct simply use
mean(HistStruct.velocity)
This will give you the average.
カテゴリ
ヘルプ センター および File Exchange で Spreadsheets についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!