HOW to open and plot .mat file

132 次查看(过去 30 天)
  1 个评论
akshat gupta
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
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
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 CenterFile Exchange 中查找有关 Structures 的更多信息

产品


版本

R2015a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by