matlab进行计算是总是出现:在赋值 A(I)=B 中,B 和 I 中的元素数目必须相同 15
clfclearallclcsymsxykmzwy=solve('20*((40/(8.8*y))^(-0.25))*(10*x+12.41*(y-2))+340*x^2...
clf
clear all
clc
syms x y k m z w
y=solve('20*((40/(8.8*y))^(-0.25))*(10*x+12.41*(y-2))+340*x^2*(1+0.2*(y/x))-0.3*8.8*(1.5*x^2-12.25)*y-26950=0','y');
k=[8.25:0.05:8.9];
m=[];
z=[];
for i=1:14
w=subs(y,k(i));
m(i)=w(abs(imag(w))<=eps);
z(i)=8.8*(m(i)-2)*1.5*(k(i))^2+400*k(i)+2*pi*1.975*(m(i)-2)*40+5*1.5*(k(i))^2*40*1.1333*(1+0.2*m(i)/k(i));%这是z关于x,y的值
end
x=k;
y=m;
subplot(1,2,1);
plot(x,y,'+-')
title('20*((40/(8.8*y))^(-0.25))*(10*x+12.41*(y-2))+340*x^2*(1+0.2*(y/x))-0.3*8.8*(1.5*x^2-12.25)*y-26950=0')
xlabel('x')
ylabel('y')
grid
subplot(1,2,2);
plot(x,z,'*-')
title('8.8*(y-2)*1.5*x^2+400*x+2*pi*1.975*(y-2)*40+5*1.5*x^2*40*1.1333*(1+0.2*y/x)')
xlabel('x')
ylabel('z')
grid
这是运行的程序 还请指教 展开
clear all
clc
syms x y k m z w
y=solve('20*((40/(8.8*y))^(-0.25))*(10*x+12.41*(y-2))+340*x^2*(1+0.2*(y/x))-0.3*8.8*(1.5*x^2-12.25)*y-26950=0','y');
k=[8.25:0.05:8.9];
m=[];
z=[];
for i=1:14
w=subs(y,k(i));
m(i)=w(abs(imag(w))<=eps);
z(i)=8.8*(m(i)-2)*1.5*(k(i))^2+400*k(i)+2*pi*1.975*(m(i)-2)*40+5*1.5*(k(i))^2*40*1.1333*(1+0.2*m(i)/k(i));%这是z关于x,y的值
end
x=k;
y=m;
subplot(1,2,1);
plot(x,y,'+-')
title('20*((40/(8.8*y))^(-0.25))*(10*x+12.41*(y-2))+340*x^2*(1+0.2*(y/x))-0.3*8.8*(1.5*x^2-12.25)*y-26950=0')
xlabel('x')
ylabel('y')
grid
subplot(1,2,2);
plot(x,z,'*-')
title('8.8*(y-2)*1.5*x^2+400*x+2*pi*1.975*(y-2)*40+5*1.5*x^2*40*1.1333*(1+0.2*y/x)')
xlabel('x')
ylabel('z')
grid
这是运行的程序 还请指教 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询