캡처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 についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by