HOW to open and plot .mat file
68 ビュー (過去 30 日間)
古いコメントを表示
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/323614/image.png)
1 件のコメント
akshat gupta
2020 年 6 月 29 日
You cannot plot a mat file. You can run the following command to first load the data stored in the mat file to the workspace, and then plot the variables you want to.
load 'S01E.mat'
回答 (1 件)
Shojiro SHIBAYAMA
2020 年 6 月 29 日
編集済み: Shojiro SHIBAYAMA
2020 年 6 月 29 日
IF you follow your way of coding with `load`, the below code will work.
x = load('S01E.mat');
figure;plot(x.data);
or, `x.data` seems a cell of structure data,
x = load('S01E.mat');
D = cell2mat(cellfun(@(element)element.(SOME_FIELD), x.data)');
figure;plot(D);
Good luck!
1 件のコメント
Shojiro SHIBAYAMA
2020 年 6 月 29 日
For your next question on MATLAB Answers, you should paste your code in text, not in image as it's difficult for others to reproduce your code from image.
参考
カテゴリ
Help Center および File Exchange で Structures についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!