필터 지우기
필터 지우기

Error : Undefined function 'minus' for input arguments of type 'struct'.

조회 수: 4 (최근 30일)
Gustavo Machado
Gustavo Machado 2016년 1월 18일
답변: Walter Roberson 2016년 1월 18일
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

답변 (1개)

Walter Roberson
Walter Roberson 2016년 1월 18일

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by