too many output argument
Mostra commenti meno recenti
I am working on control of robot puma560 by using Matlab Simulink which contains 5 Matlab function blocks. when I run a genetic algorithm to tune PD, it says too many output argument. does ga conflict with Matlab function blocks in Simulink or what?
%fitness function
function y=fit2(x)
global kp kv
kp=x(1);
kv=x(2);
disp([kp kv])
sim('new_sim2qaex')
y= mean(abs(error));
Too many output arguments.
Error in fit2 (line 8)
y= mean(abs(error));
Error in createAnonymousFcn>@(x)fcn(x,FcnArgs{:}) (line 11)
fcn_handle = @(x) fcn(x,FcnArgs{:});
Error in gamultiobjMakeState (line 27)
Score = FitnessFcn(state.Population(1,:));
Error in gamultiobjsolve (line 8)
state = gamultiobjMakeState(GenomeLength,FitnessFcn,ConstrFcn,output.problemtype,options);
Error in gamultiobj (line 274)
[x,fval,exitFlag,output,population,scores] = gamultiobjsolve(FitnessFcn,nvars, ...
Caused by:
Failure in initial fitness function evaluation. GAMULTIOBJ cannot continue.
2 Commenti
Walter Roberson
il 25 Mar 2019
global variables act differently in Simulink. You should avoid using them.
asmaa abdelstar
il 25 Mar 2019
Risposte (1)
Walter Roberson
il 25 Mar 2019
0 voti
Assign a value to the variable error before calling sim
Otherwise, MATLAB will think you are referring to the function named error(), which does not have any outputs.
1 Commento
asmaa abdelstar
il 25 Mar 2019
Categorie
Scopri di più su Linear Least Squares in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!