2 input and one out in plot

3 ビュー (過去 30 日間)
iman
iman 2013 年 12 月 24 日
編集済み: Image Analyst 2013 年 12 月 24 日
in this image in example of spectrum analysis of sinusidal signals i want input plot 1 and plot 2 and i want that matlab Draw plot 3 Diagram . what commands can do this problem ? please help man tankyou
meanwhile 1 plot is cos(pi/3n)+0.75cos(2pi/3n) and 2 plot is rectangular window

採用された回答

Image Analyst
Image Analyst 2013 年 12 月 24 日
It looks like the stem() function will create that kind of plot.
  2 件のコメント
iman
iman 2013 年 12 月 24 日
can you help me in create that plot please
Image Analyst
Image Analyst 2013 年 12 月 24 日
編集済み: Image Analyst 2013 年 12 月 24 日
Did you look at any of the 13 examples from the help? Well, here, I did it for you:
% Create data.
x = -3:11;
y1 = cos(x .* pi/3)+0.75*cos(2*x*pi/3);
y2 = [0,0,0,1,1,1,1,1,1,1,1,0,0,0,0]
y3 = y1 .* y2;
% Plot top graph.
subplot(3,1,1);
stem(x,y1, 'Color', 'k', 'MarkerFaceColor', 'k', 'LineWidth', 3);
xlim([-3,11]);
ylim([-2,2]);
grid on;
% Enlarge figure to full screen.
set(gcf, 'Units', 'Normalized', 'OuterPosition', [0 0 1 1]);
% Plot top graph.
subplot(3,1,2);
stem(x,y2, 'Color', 'k', 'MarkerFaceColor', 'k', 'LineWidth', 3);
xlim([-3,11]);
ylim([0, 1.2]);
grid on;
% Plot top graph.
subplot(3,1,3);
stem(x,y3, 'Color', 'k', 'MarkerFaceColor', 'k', 'LineWidth', 3);
xlim([-3,11]);
ylim([-2, 2]);
grid on;

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeAnnotations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by