캡처12.PNG
I want to draw this plot but I don't know how check the point (2pi,-2) and (6pi,4) (like that , the Solid line)
please help me...!!

 채택된 답변

Star Strider
Star Strider 2019년 1월 4일

2 개 추천

This should get you started:
x = linspace(0, 10*pi); % Create Data
y = sin(x*0.3) + randn(size(x))/10; % Create Data
y2pi = interp1(x, y, 2*pi); % Interpolate To Find ‘y=2*pi’
y6pi = interp1(x, y, 6*pi); % Interpolate To Find ‘y=6*pi’
figure
plot(x, y)
hold on
plot(xlim, [0 0], '-k', 'LineWidth',2)
plot([0 2*pi], [1 1]*y2pi, '--k', [1 1]*2*pi, [0 1]*y2pi, '--k')
plot([0 6*pi], [1 1]*y6pi, '--k', [1 1]*6*pi, [0 1]*y6pi, '--k')
hold off
% set(gca, 'XAxisLocation','origin')
text(2*pi, y2pi, '2\pi', 'HorizontalAlignment','center', 'VerticalAlignment','bottom', 'FontSize',15)
text(6*pi, y6pi, '6\pi', 'HorizontalAlignment','center', 'VerticalAlignment','top', 'FontSize',15)
How I make the plot like this - 2019 01 03.png
You will have to experiment with your own data, and probably adjust the 'VerticalAlignment' values in the text calls.. However this will do all the calculations and the plotting.

댓글 수: 2

Jinwoo Bae
Jinwoo Bae 2019년 1월 29일
Thanks!
Star Strider
Star Strider 2019년 1월 29일
As always, my pleasure!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터 및 File Exchange에서 Desktop에 대해 자세히 알아보기

태그

질문:

2019년 1월 4일

댓글:

2019년 1월 29일

Community Treasure Hunt

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

Start Hunting!

Translated by