Info
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
Stretch peak to peak y-values to plot
조회 수: 1 (최근 30일)
이전 댓글 표시
figure(1)
x =[0 pi/2 pi 3*pi/2 2*pi 5*pi/2 3*pi];
y = [0 1 0 -1 0 1 0];
bcs = csapi(x,y);
xx=linspace(0,3*pi,1000);
val=fnval(bcs,xx);
xbound=peakdet(val,.5);
period=val(:,xbound(1,1):xbound(2,1));
plot(period)
figure(2)
x2 =[0 pi/2-1.5 pi+1.5 3*pi/2 2*pi-1.5 5*pi/2+1.5 3*pi];
y = [0 1 0 -1 0 1 0];
bcs = csapi(x2,y);
xx=linspace(0,3*pi,1000);
val=fnval(bcs,xx);
xbound=peakdet(val,.5);
period=val(:,xbound(1,1):xbound(2,1));
plot(period)
The lengths of fig1 period=712, fig2 period=462. I want to stretch or compress one of these vectors so that they reach their peaks at the same indices=>period lengths are the same, while still keeping their shape. I tried interp1 but none of the methods plotted out the way I wanted it to. Is there some other function/trick I could try?
댓글 수: 0
답변 (0개)
이 질문은 마감되었습니다.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!