Filter löschen
Filter löschen

Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

Getting an Error in input arguments

1 Ansicht (letzte 30 Tage)
Ace_ventura
Ace_ventura am 2 Mai 2015
Geschlossen: MATLAB Answer Bot am 20 Aug. 2021
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
  1 Kommentar
Image Analyst
Image Analyst am 2 Mai 2015
The first function does not return a variable called Dos, so that will be a problem. Also, you did not include the function called ga(). What is the name of the main function / m-file? and show us line 342 where your main function calls ga(). And of course attach ga().

Antworten (0)

Diese Frage ist geschlossen.

Community Treasure Hunt

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

Start Hunting!

Translated by