How to plot magnitude vs length from magnitude vs time plot

3 views (last 30 days)
I have the magnitude (amplitude) vs time Y.X values obtained.
I would like to know how can I plot magnitude vs length of the specimen in which I have obtained these signals?
Ramesh Bala
Ramesh Bala on 5 Mar 2021
Or is there a way to plot wavenumber vs magnitude from it?

Sign in to comment.

Accepted Answer

William Rose
William Rose on 6 Mar 2021
If your strain versus time data is in a matrix e which is Nx6 (i.e. a column for each length, and N time points=N rows), then do this:
delamL=[5 10 20 30 40 50];
If your matrix e is 6xN (a row for each length), then replace the second line with emax=max(e');
Here is an example of what I mean.
%BalaCode.m WCR 20210305
%Make some data like K. Bala's data
e(200:end,1)=12.5*cos(1.3e6*t(200:end) ).*(sin((t(200:end)-2e-5)*7.8e4)).^2;
e(200:end,3)= 8*cos(1.3e6*t(200:end)-pi/2).*(sin((t(200:end)-2e-5)*7.8e4)).^2;
e(200:end,4)= 6.2*cos(1.3e6*t(200:end)+pi ).*(sin((t(200:end)-2e-5)*7.8e4)).^2;
e(200:end,5)= 7.2*cos(1.3e6*t(200:end)+pi/3).*(sin((t(200:end)-2e-5)*7.8e4)).^2;
e(200:end,6)= 8.2*cos(1.3e6*t(200:end)-pi/3).*(sin((t(200:end)-2e-5)*7.8e4)).^2;
%Make a plot like K. Bala's first plot
xlabel('Time (s)'); ylabel('Strain');
%Now the code to make the plot which K. Bala requested:
%Plot peak strain vs. delamination length
delamL=[5 10 20 30 40 50];
xlabel('Delam.Length (mm)'); ylabel('Max.Strain');
If using this forum in the future, I recommend supplying a short example of the kind of data you are working with, because it makes it a lot easier for others to assist you.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!