Is there a mistake on my code which determines value that minimizes the function?
显示 更早的评论
I have been creating a minimal code located at the code-box for minimize the function, but i'm not sure working of code is correctly. Is there any wrong?
Thx.
clear all
clc
slo=[0.01 0.012 0.013 0.012 0.008 0];
for i=1:1:numel(slo);
WR(i)=0.01*9.81*1700*cos(i);
WL=@(velo) 0.5*0.25*1.2*2.65.*velo^2;
WS(i)=9.81*1700*sin(i);
WB=0;
end
WT=@(velo) sum(WR)+WL(velo)+sum(WS)+WB;
fun = @(velo) WT(velo);
x1 = 50/3.6;
x2 = 90/3.6;
options = optimset('Display','iter');
velo = (fminbnd(fun,x1,x2,options))*3.6 %km/h
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Startup and Shutdown 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!