How to plot magnitude vs length from magnitude vs time plot

5 ビュー (過去 30 日間)
Ramesh Bala
Ramesh Bala 2021 年 3 月 4 日
回答済み: William Rose 2021 年 3 月 6 日
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?
  4 件のコメント
darova
darova 2021 年 3 月 5 日
That's too complicated
Ramesh Bala
Ramesh Bala 2021 年 3 月 5 日
Or is there a way to plot wavenumber vs magnitude from it?

サインインしてコメントする。

採用された回答

William Rose
William Rose 2021 年 3 月 6 日
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];
emax=max(e);
plot(delamL,emax);
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
t=[0:.01:6]*1e-5;
e=zeros(length(t),6);
e(200:end,1)=12.5*cos(1.3e6*t(200:end) ).*(sin((t(200:end)-2e-5)*7.8e4)).^2;
e(200:end,2)=11.8*cos(1.3e6*t(200:end)+pi/2).*(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
plot(t,e(:,1),'r-',t,e(:,2),'g-',t,e(:,3),'b-',t,e(:,4),'c-',t,e(:,5),'m-',t,e(:,6),'y-');
xlabel('Time (s)'); ylabel('Strain');
legend('5','10','20','30','40','50');
%Now the code to make the plot which K. Bala requested:
%Plot peak strain vs. delamination length
delamL=[5 10 20 30 40 50];
emax=max(e);
figure;
plot(delamL,emax,'k.-');
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.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMultirate Signal Processing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by