plotting .mat file......
82 ビュー (過去 30 日間)
古いコメントを表示
Hi, I want to plot from spectrum.mat file but it giving me following error. Error using plot Invalid first data argument. Error in data (line 5) plot('spectrum.mat')
But when I exactly load this file then it loading and at right in 'workspace box' giving "spec 401x2 double" values.
Could anyone please let me know that why I can't plot this "spectrum.mat" file, kindly if someone show me the procedure for plotting .mat files. By the way in this spectrum.mat file there are two columns (e.g x-axis Frequency and y-axis Scale) and 401 rows.
Thanks
0 件のコメント
採用された回答
Jan
2017 年 4 月 26 日
"plot('spectrum.mat')"?! This tries to plot the char vector 'spectrum.mat'.
You cannot plot a file. You have to load the data at first:
Data = load('spectrum.mat');
Now you can plot the data, perhaps by:
plot(Data.spec)
Or
plot(Data.spec(:,1), Data.spec(:,2))
7 件のコメント
Walter Roberson
2020 年 10 月 5 日
Yes, the x2 indicates two columns. This is standard output format for "whos", the dimension sizes separated by 'x'
You do appear to have 200 columns.
You can use that syntax, provided that the name of the saved variable is spec and you assign the result of load() to the variable named Data
However, I suspect that would be the wrong thing to do. I suspect that you have either 4853 stress sites sampled at 200 times, or else 200 stress sites sampled at 4853 times. I suspect you should use something more like a waterfall plot.
Nawsheen Tarannum Promy
2020 年 10 月 22 日
Hi, I'm using 3 variables and it gives me error saying tabular/plot and tells me to use stackedplot function. Can you help me with this?
その他の回答 (1 件)
Moiz Tariq
2018 年 12 月 5 日
編集済み: Moiz Tariq
2018 年 12 月 5 日
See tthe name of file in workspace
let's say the name is wwe
write in comand window
[load'wwe.mat'
x=wwe(:, 1)
y=wwe(:,2)
plot(x,y)]
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Encryption / Cryptography についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!