Commit ddeebb7b authored by WALL-E's avatar WALL-E
Browse files

我看了一下,就这几个的图需要改,1.5(d)的图例两个颜色一样,我不知道怎么改。

parent 365b9cce
Loading
Loading
Loading
Loading
+6 −9
Original line number Diff line number Diff line
@@ -6,16 +6,13 @@ y1=sin((pi/2)*x1);
y2=sin((pi/2)*x2);

%Plot
subplot(2,1,1);
stem(n,y1);
title('1.4 (a)-1');
xlabel('n');
ylabel('y_1=sin((\pi/2) x_1[n])');

subplot(2,1,2);
stem(n,y2,'r');
title('1.4(a)-2');
stem(n,y1,'g--*');
hold on;
stem(n,y2,'r--s');
legend('y_1=sin((\pi/2) x_1[n]','y_2=sin((\pi/2) x_2[n]')
title('1.4 (a)');
xlabel('n');
ylabel('y_2=sin((\pi/2) x_2[n])');
ylabel('y[n])');

saveas(gcf, "LAB1/P1_4_a_out.png")
 No newline at end of file
+8 −11
Original line number Diff line number Diff line
@@ -4,28 +4,25 @@ x2=5*[zeros(1,5) 1 zeros(1,5)];
y1=sin((pi/2)*x1);
y2=sin((pi/2)*x2);

subplot(4,1,1);
subplot(3,1,1);
stem(n,x1);
title('1.4 (d)-1');
xlabel('n');
ylabel('x1[n]');

subplot(4,1,2);
subplot(3,1,2);
stem(n,x2);
title('1.4 (d)-2');
xlabel('n');
ylabel('x2[n]');

subplot(4,1,3);
stem(n,y1,'m--s');
title('1.4 (d)-3');
xlabel('n');
ylabel('sin(\pi/2) x1[n]');

subplot(4,1,4);
subplot(3,1,3);
stem(n,y1,'b--s');
hold on;
stem(n,y2,'r--h');
title('1.4(d)-4');
legend('sin(\pi/2) x1[n]','sin(\pi/2) x2[n]')
title('1.4 (d)-3');
xlabel('n');
ylabel('sin(\pi/2) x2[n]');
ylabel('y[n]');

saveas(gcf, "LAB1/P1_4_d_out.png")
 No newline at end of file
+4 −6
Original line number Diff line number Diff line
@@ -7,12 +7,10 @@ y1=diffeqn(a,x,yn1);
yn1=0.5;
y2=diffeqn(a,x,yn1);

subplot(1,2,1);
stem(n,y1,'r--p');
xlabel('y[-1]=0');

subplot(1,2,2);
stem(n,y2,'m--s');
xlabel('y[-1]=0.5');
hold on;
stem(n,y2,'b--s');
legend('y[-1]=0','y[-1]=0.5');

title('1.5(d)');
saveas(gcf, "LAB1/P1_5_d_out.png")
 No newline at end of file