HOW to open and plot .mat file

조회 수: 68 (최근 30일)
Sayantan Mukherjee
Sayantan Mukherjee 2020년 6월 29일
댓글: Shojiro SHIBAYAMA 2020년 6월 29일
  댓글 수: 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