新手求教matlab fmincon函数的问题 等待中.求在0<α<=π/2;0<β<=π/2,θ=0时的最小值,function f=myfirstfun(x)f=abs(1/((sqrt(sin(x(1)/180*pi)*sin(x(2)/180*pi)))*(cos((x(1)+x(2))/180*pi))));x0=[1;1];[x,fval] = fmincon('my
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/17 11:02:50
新手求教matlab fmincon函数的问题 等待中.求在0<α<=π/2;0<β<=π/2,θ=0时的最小值,function f=myfirstfun(x)f=abs(1/((sqrt(sin(x(1)/180*pi)*sin(x(2)/180*pi)))*(cos((x(1)+x(2))/180*pi))));x0=[1;1];[x,fval] = fmincon('my
新手求教matlab fmincon函数的问题 等待中.
求
在0<α<=π/2;0<β<=π/2,θ=0时的最小值,
function f=myfirstfun(x)
f=abs(1/((sqrt(sin(x(1)/180*pi)*sin(x(2)/180*pi)))*(cos((x(1)+x(2))/180*pi))));
x0=[1;1];
[x,fval] = fmincon('myfirstfun',x0,[],[],[],[],[1;90],[1;90])
运行结果
x =
1
90
fval =
433.7276
但是α=β=24的时候才是最小值;
新手求教matlab fmincon函数的问题 等待中.求在0<α<=π/2;0<β<=π/2,θ=0时的最小值,function f=myfirstfun(x)f=abs(1/((sqrt(sin(x(1)/180*pi)*sin(x(2)/180*pi)))*(cos((x(1)+x(2))/180*pi))));x0=[1;1];[x,fval] = fmincon('my
[x,fval] = fmincon(@myfirstfun,x0,[],[],[],[],[0;0],[90;90])%这句写错了,改一下就好了