How to plot magnitude vs length from magnitude vs time plot

조회 수: 2 (최근 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 CenterFile Exchange에서 Multirate Signal Processing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by