我想利用fminsearch來尋找滑杆的最小速度,方程式如下:
function f = fun(theta)
OA=0.15;
AB=0.5;
rpm=2000;
omega=rpm*2*pi/60;
f =
-OA*omega*sin(theta)-OA^2*omega*sin(2*theta)./(2*sqrt(AB^2-OA^2*(sin(theta).^2)));
fun此方程式沒有錯誤,但是使用fminsearch卻出現以下問題:
[theta,fval] = fminsearch(@fun,[-1,1])
??? Subscripted assignment dimension mismatch.
Error in ==> fminsearch at 205
fv(:,1) = funfcn(x,varargin{:});
請問該如何解決呢?
謝謝各位板友啦!