在matlab下用下面公式画图:“S1的a次方”加“S2的a次方”等于“C的a次方”.

1个回答

  • 程序如下:你给的数据没有同心正方形.%%%%%%%%%%%%当a=0.5时clc;clear;c=[1,2,3,4];for i=1:4 s1=-4:4; s2=-4:4; s2=(sqrt(c(i))-sqrt(s1)).^2 plot(s1,s2); hold onend

    %%%%%%%%%%a=1时候为直线clc;clear;c=[1,2,3,4];%%%当a=2时候,s1=-10:1:10;for i=1:4 s2=c(i)-s1; plot(s1,s2); hold on axis equal hold on xlabel('s1'); ylabel('s2'); title('不同的直线');end

    %%%%%%%%%%a=2时候同心圆clc;clear;c=[1,2,3,4];%%%当a=2时候,row=0:pi/20:2*pi;for i=1:4 R=c(i)^2; s1=R*cos(row) s2=R*sin(row); plot(s1,s2) hold on axis equal xlabel('s1'); ylabel('s2'); title('半径不同的同心圆');end