HOW to open and plot .mat file

132 Ansichten (letzte 30 Tage)
Sayantan Mukherjee
Sayantan Mukherjee am 29 Jun. 2020
  1 Kommentar
akshat gupta
akshat gupta am 29 Jun. 2020
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'

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Shojiro SHIBAYAMA
Shojiro SHIBAYAMA am 29 Jun. 2020
Bearbeitet: Shojiro SHIBAYAMA am 29 Jun. 2020
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 Kommentar
Shojiro SHIBAYAMA
Shojiro SHIBAYAMA am 29 Jun. 2020
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.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Structures finden Sie in Help Center und File Exchange

Produkte


Version

R2015a

Community Treasure Hunt

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

Start Hunting!

Translated by