How do I load and plot the .mat file

How do I plot it out? Thank you for anyone who can help

댓글 수: 4

Mathieu NOE
Mathieu NOE 2021년 11월 5일
hello
I got no data when loading - empty mat file ??
Junzhen Liu
Junzhen Liu 2021년 11월 5일
Sorry, can you check this one?
This cannot work:
load('A1S1.mat', '_1_Time')
Names of variables cannot start with an underscore.
What is the contents of the mat file?
data = load('A1S1.mat')
Junzhen Liu
Junzhen Liu 2021년 11월 5일
Sorry, I just update the file, can you check again?

댓글을 달려면 로그인하십시오.

답변 (1개)

DGM
DGM 2021년 11월 5일
편집: DGM 2021년 11월 5일

0 개 추천

This is one way:
S = load('lab31part1.mat');
t = S.lab3_part1_Time;
v = S.lab3_part1_Value;
subplot(2,1,1)
plot(t(:,1),v(:,1))
grid on
subplot(2,1,2)
plot(t(:,2),v(:,2))
grid on
Or if you want them in the same axes:
clf % just to reset web-plot
S = load('lab31part1.mat');
t = S.lab3_part1_Time;
v = S.lab3_part1_Value;
plot(t,v)
grid on

카테고리

도움말 센터File Exchange에서 Creating, Deleting, and Querying Graphics Objects에 대해 자세히 알아보기

제품

태그

질문:

2021년 11월 5일

댓글:

2021년 11월 5일

Community Treasure Hunt

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

Start Hunting!

Translated by