这个画图程序哪里错了,看不出问题,求指教。

u=[1.121053,1.052632,1.000000,0.947368,0.905263,0.852632,0.800000,0.747368,0.705263,0.652632,0.600000,0.547368,0.526316,0.505263];
p=[0.484515,0.428333,0.412780,0.403545,0.400569,0.386055,0.386709,0.380415,0.375948,0.373822,0.374814,0.367592,0.366922,0.371988];
q=[0.922466,0.736968,0.630898,0.531095,0.465205,0.404971,0.335861,0.285312,0.252639,0.216848,0.181531,0.167480,0.161788,0.157905];
c1=polyfit(u,p,2);
x1=0:0.02:1.4;
y1=polyval(c1,x1);
z1=0.407*(x1.^0.074);
w1=0.4*(x1.^2)-0.5*x1+0.53;
plot(x1,y1,'r-o',u,p,'g-.p')
axis([0.5 1.1 0.3 0.5]);
xlabel('U(电压)');ylabel('P(有功功率)');
c2=polyfit(u,q,2);
x2=0:0.02:1.4;
y2=polyval(c2,x2,5);
z2=0.58*(x1.^1.39);
w2=2*x2.^2-2*x2+0.67;
figure(2)
plot(x2,y2,'r-o',u,q,'g-.p');
axis([0.5 1.1 0 0.9]);
xlabel('U(电压)');ylabel('Q(无功功率)');

 Réponse acceptée

biyac
biyac le 23 Nov 2022

0 votes

这个程序的命名有问题,m文件首先不要和内部函数名重复,然后开头要用英文字母,不能有空格,可以有下划线

Plus de réponses (0)

Catégories

En savoir plus sur 建模 dans Centre d'aide et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!