早教吧作业答案频道 -->其他-->
matlab多变量函数求最值Attempttoaccessminimum(-20,0,1.2)indexmustbeapositiveintegerlogical求最小受力minimum的值,刚刚接触matlab,r=1.2:0.01:2.2;theta=-20:1:80;delta=0:1:100;m=4;g=9.8;L=4;c2=(2.2^2-1.2^2)./(co
题目详情
matlab多变量函数求最值Attempt to access minimum(-20,0,1.2)index must be a positive integer logical
求最小受力 minimum的值,刚刚接触matlab,
r = 1.2:0.01:2.2;
theta = -20:1:80;
delta = 0:1:100;
m = 4;
g = 9.8;
L = 4;
c2 = (2.2^2 - 1.2^2)./(cos(delta - 20) - cos(delta + 80));
c1 = 2.2^2 + c2.*cos(delta +80);
a = (sqrt(c1 +c2) + sqrt(c1 - c2))/2;
b = c2/(2*a);
x = 1000000;
for theta = -20:1:100
for delta = 0:1:100
for r = 1.2:0.01:2.2
minimum = m.*r*g*L.*cos(theta)'./a.*b.*sin(theta + delta);
if minimum(theta,delta,r) < x
x = minimum(theta,delta,r);
end
end
end
end
disp (x)
求最小受力 minimum的值,刚刚接触matlab,
r = 1.2:0.01:2.2;
theta = -20:1:80;
delta = 0:1:100;
m = 4;
g = 9.8;
L = 4;
c2 = (2.2^2 - 1.2^2)./(cos(delta - 20) - cos(delta + 80));
c1 = 2.2^2 + c2.*cos(delta +80);
a = (sqrt(c1 +c2) + sqrt(c1 - c2))/2;
b = c2/(2*a);
x = 1000000;
for theta = -20:1:100
for delta = 0:1:100
for r = 1.2:0.01:2.2
minimum = m.*r*g*L.*cos(theta)'./a.*b.*sin(theta + delta);
if minimum(theta,delta,r) < x
x = minimum(theta,delta,r);
end
end
end
end
disp (x)
▼优质解答
答案和解析
minimum(theta,delta,r)
下标只能是正数.你的theta & r都不符合要求,你的minimun是一个数组,而不是一个函数
if minimum < x
x = minimum;
end
改成这样子试试
下标只能是正数.你的theta & r都不符合要求,你的minimun是一个数组,而不是一个函数
if minimum < x
x = minimum;
end
改成这样子试试
看了 matlab多变量函数求最值...的网友还看了以下:
Theyhaveanaaaaalessonfromeightthirtytonineten.请在下 2020-04-25 …
中心在原点,焦点在x轴上的双曲线C1的离心率为e,直线l与双曲线C1交于A,B两点,线段AB中点M 2020-05-13 …
连字成词(英语)l u o e b s r u s r e t o s w a e s r t e 2020-05-14 …
将字母组成单词,并译成汉语1.m,e,r,m,u,s,汉语2.u,l,t,e,c,u,r,汉语3. 2020-06-04 …
重新排列字母,写出单词1.s,a,p,e,c,2.r,o,e,t,c,k,3.d,c,o,o,t, 2020-06-06 …
A.根据释义,拼写单词.1.costingalotofmoneyx,p,s,i,e,e,e,n,v 2020-06-10 …
英语单词填空1.时间状语:d-r-n-2.场所:b-s-s-o-f-r--e-a-t-e-t3.教 2020-07-14 …
英语、成语问题身()志()o,o,b,b,a,m单词:中文:()e,a,l,f单词:中文:()t, 2020-07-24 …
化学平衡中的气、液、固三系是否分开讨论…?比如,mA(g)+nB(l)=pC(g)+qD(l)+rE 2020-11-03 …
英文单词分类填空动物类1.O()t()p()s2.k()t()e()3.l()b()t()r4.a( 2021-02-05 …