getting an error " not enough input arguments"

6 visualizaciones (últimos 30 días)
Ace_ventura
Ace_ventura el 1 de Mayo de 2015
Editada: Ace_ventura el 2 de Mayo de 2015
error is
>>Error using ga (line 342)
Not enough input arguments.
Caused by: Failure in initial user-supplied nonlinear constraint function evaluation.
I guess it is because of the way I have defined functions. I have three function files.My functions are defined as :FIRST FUNCTION IS DEFINED AS
function Dos=Databeam(x)
% Units: KN & m
m=2;n=3;
x=mapvariablesbeam(x);
SECOND FUNCTION IS DEFINED AS
function x = mapvariablesbeam(x)
THIRD FUNCTION IS DEFINED AS
function [c, ceq] = ga_beamconstraints(x,Dos)
% Problem parameters
Lb=2; %in m
deltaMax =Lb/325 ; % Maximum end deflection in m
sigmaMax =130e3 ; % Maximum stress in each section of the beam in kN/m
x = mapvariablesbeam(x);
% Constraints on the stress
momax=Dos.momax;
momax variable is created in first function file and I need to access it in this function file so I have used Dos.momax

Respuestas (1)

Joseph Cheng
Joseph Cheng el 1 de Mayo de 2015
Editada: Joseph Cheng el 1 de Mayo de 2015
This sounds like the perfect spot to use the editor's debug abilities. it error that matlab gives you should indicate what where the error is in what line. Since you didn't supply any code it'd just be speculation that you didn't implement the beamconst function to take the structure correctly. put a breakpoint and see what in the line is breaking down and not defined.

Categorías

Más información sobre Stress and Strain en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by