Error : Undefined function 'minus' for input arguments of type 'struct'.
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponses (1)
Walter Roberson
le 18 Jan 2016
Parameterize your call to your function. See http://www.mathworks.com/help/matlab/math/parameterizing-functions.html
0 commentaires
Voir également
Catégories
En savoir plus sur Entering Commands dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!