Is there a mistake on my code which determines value that minimizes the function?
Mostrar comentarios más antiguos
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
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Startup and Shutdown en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!