matlab中legend命令注释的颜色p=2;n=0:1:500;pSeries=1./(n.^p);pSeries(1)=0;P=pi*pi/6;figure;plot(n,P,'r');hold onplot(n,cumsum(pSeries),'b');legend('Infinite sum','Finite sum')xlabel('Index');ylabel('Sum');title('Convergence of p-series with p=
来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/28 19:43:27
matlab中legend命令注释的颜色p=2;n=0:1:500;pSeries=1./(n.^p);pSeries(1)=0;P=pi*pi/6;figure;plot(n,P,'r');hold onplot(n,cumsum(pSeries),'b');legend('Infinite sum','Finite sum')xlabel('Index');ylabel('Sum');title('Convergence of p-series with p=
matlab中legend命令注释的颜色
p=2;
n=0:1:500;
pSeries=1./(n.^p);
pSeries(1)=0;
P=pi*pi/6;
figure;
plot(n,P,'r');
hold on
plot(n,cumsum(pSeries),'b');
legend('Infinite sum','Finite sum')
xlabel('Index');
ylabel('Sum');
title('Convergence of p-series with p=2');
为什么注释里两条线的颜色都是红色的?legend的用法不对吗?
matlab中legend命令注释的颜色p=2;n=0:1:500;pSeries=1./(n.^p);pSeries(1)=0;P=pi*pi/6;figure;plot(n,P,'r');hold onplot(n,cumsum(pSeries),'b');legend('Infinite sum','Finite sum')xlabel('Index');ylabel('Sum');title('Convergence of p-series with p=
p=2;
n=0:1:500;
pSeries=1./(n.^p);
pSeries(1)=0;
P(n+1)=pi*pi/6; %这里的P原来的大小是1,作出来的图是不对的,所以你看不到正确的legend
plot(n,P,n,cumsum(pSeries));
legend('Infinite sum','Finite sum')
xlabel('Index');
ylabel('Sum');
title('Convergence of p-series with p=2');