Error : Undefined function 'minus' for input arguments of type 'struct'.
조회 수: 4 (최근 30일)
이전 댓글 표시
Dear All,
I've been trying to use the fsolve function, but i keep getting this following error and i can't fix it.
Undefined function 'minus' for input arguments of type 'struct'.
Error in CircleLowEpplerFlap (line 4)
F = [(CircleLowX - x(1))^2 + (CircleLowY - x(2))^2 - (RLow)^2;
Error in fsolve (line 219)
fuser = feval(funfcn{3},x,varargin{:});
Error in FlapShapeEppler (line 371)
[xLow] = fsolve(@CircleLowEpplerFlap,CircleLowx0,CircleLowX, CircleLowY, AFFlap, RLow);
Caused by:
Failure in initial user-supplied objective function evaluation. FSOLVE cannot continue.
This is the way i'm calling the fsolve function on my code :
CircleLowX = AFFlap.Elipse2LowerX(end);
CircleLowY = AFFlap.Elipse2LowerY(end);
CircleLowx0 = [AFFlap.LowerX(1) AFFlap.Elipse2LowerY(end)];
RLow = 0.01;
[xLow] = fsolve(@CircleLowEpplerFlap,CircleLowx0,CircleLowX, CircleLowY, AFFlap, RLow);
CircleLowCenterX = xLow(1);
CircleLowCenterY = xLow(2);
The CircleLowEpplerFlap code is:
function [ F ] = CircleLowEpplerFlap( x ,CircleLowX, CircleLowY, AFFlap, RLow )
F = [(CircleLowX - x(1))^2 + (CircleLowY - x(2))^2 - (RLow)^2;
(AFFlap.LowerX(1) - x(1))^2 + (AFFlap.LowerY(1) - x(2))^2 - (RLow)^2 ];
end
These are the variables values on my Workspace when i break the code before the fsolve funcion:
CircleLowX = 0.5855
CircleLowY = 0.0198
CircleLowx0 = [0.5934 0.0198]
I couldn't find any solution to this problem.
Any help would be greatly appreciated,
Thanks
댓글 수: 0
답변 (1개)
Walter Roberson
2016년 1월 18일
Parameterize your call to your function. See http://www.mathworks.com/help/matlab/math/parameterizing-functions.html
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!