[请益] fminsearch错误,dimension mismatch

楼主: RachelMcAdam (瑞秋卖灯丝)   2014-05-25 08:18:55
我想利用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{:});
请问该如何解决呢?
谢谢各位板友啦!

Links booklink

Contact Us: admin [ a t ] ucptt.com