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 CenterFile Exchange에서 Annotations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by