I want to plot mat file

38 Ansichten (letzte 30 Tage)
sandhya sandhya
sandhya sandhya am 20 Aug. 2018
Bearbeitet: sandhya sandhya am 5 Sep. 2018
I want to plot mat file with command s=load('signal.mat'); plot(s) but there is error in that command how to plot the signal
  4 Kommentare
madhan ravi
madhan ravi am 20 Aug. 2018
Bearbeitet: madhan ravi am 20 Aug. 2018
FYI there is no file attached , please click the paper clip button and then upload it.
sandhya sandhya
sandhya sandhya am 20 Aug. 2018
Thank you for reply .I attached my file

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Stephan
Stephan am 20 Aug. 2018
Bearbeitet: Stephan am 20 Aug. 2018
Hi,
s = load('signal.mat');
will give you a struct s containing fields with your variable(s) in it. Access this data fields with the dot-Notation:
plot(s.your_variable_name_to_plot)
should work.
EDIT:
Your file contains a numeric Matrix of size 10x20480 which appears like 10 data sets - which shall be plotted?
s = load('signal.mat');
plot(transpose(s.val))
will plot all the data in one plot:
Best regards
Stephan
  6 Kommentare
sandhya sandhya
sandhya sandhya am 21 Aug. 2018
Thank you sir its working.
sandhya sandhya
sandhya sandhya am 5 Sep. 2018
Bearbeitet: sandhya sandhya am 5 Sep. 2018
My signal variable value is 1*2560 double and i tried this code to plot the signal s = load('test.mat'); val = (val - 1024)/200; signal = val(1,1:1000); Fs = 360; t = (0:length(signal)-1)/360; plot(t,signal ),grid on we can plot the signal with the above command lines.But can anybody explain about this code.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Change Markers finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by