How to plot a curved signal ?
이전 댓글 표시
Can anybody tell me how can I plot a signal like that one represented in the figure below ? I just need the part of the signal from 10 to 15. I have the following code until now :
time = 0:0.1:15;
xArray = zeros(1,numel(time)); %numel gives the number of the elements that an array has
for index = 1:numel(time)
if(time(index)>5 && time(index)<7)
xArray(index) = (time(index)-5)/2;
elseif(time(index))>= 7 && (time(index))<10
xArray(index) = 1;
elseif ((time(index) >= 10 && time(index)<15))
xArray(index) = (15 - time(index))/5;
end
end
figure (2)
plot(time,xArray);
axis([0 15 0 5]);

채택된 답변
추가 답변 (2개)
Akira Agata
2018년 10월 15일
How about the following?
figure
plot(time,xArray)
ax = gca;
ax.YTick = [0 1];
ax.XTick = [5 7 10 15];

Biro Darius
2018년 10월 18일
0 개 추천
댓글 수: 3
Image Analyst
2018년 10월 18일
Call ifft() on the signal.
Biro Darius
2018년 10월 25일
Image Analyst
2018년 10월 25일
Yes, he wants you to do it "manually" instead of having the ifft() function do it for you.
카테고리
도움말 센터 및 File Exchange에서 Data Distribution Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
