How to plot graph from mat file?
34 ビュー (過去 30 日間)
古いコメントを表示
Hi everyone, I face a difficulty in plotting graph from mat file. I want to get the graph from the mat file but the graph did not pop out and get the result in command window as shown in the figure 1 below.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/279283/image.jpeg)
Figure 1
The figure 2 below is the setting for the code.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/279284/image.jpeg)
Anyone can help me? Thanks. This is the code I am using:
clc;
clear all;
close all;
s = load('lai3.mat');
plot(transpose(s.val))
採用された回答
Subhamoy Saha
2020 年 3 月 25 日
clc;
clear all;
close all;
s = load('lai3.mat');
x=s.lai3(:,1); % s is having a field named lai3
y=s.lai3(:,2);
plot(x,y)
4 件のコメント
Subhamoy Saha
2020 年 3 月 25 日
Can you tell what was the problem because I'm getting plot with the sugested line of codes.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Startup and Shutdown についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!