Borrar filtros
Borrar filtros

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

10 visualizaciones (últimos 30 días)
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

Respuestas (1)

Walter Roberson
Walter Roberson el 18 de En. de 2016

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by