plotting .mat file......
465 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Murtaza Ali Khan
le 26 Avr 2017
Commenté : Nawsheen Tarannum Promy
le 22 Oct 2020
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 commentaires
Réponse acceptée
Jan
le 26 Avr 2017
"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 commentaires
Walter Roberson
le 5 Oct 2020
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
le 22 Oct 2020
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?
Plus de réponses (1)
Moiz Tariq
le 5 Déc 2018
Modifié(e) : Moiz Tariq
le 5 Déc 2018
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 commentaires
Voir également
Catégories
En savoir plus sur Contour Plots dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!