How to return multiple variables in a function call in MATLAB R 2015b?
Show older comments
I have written a function as written below. function [avgfit,pipop,bestfit]= gafitness(psz,n,pop)
But when i called this function in another script m-file , with the following line [avgfit,pipop,bestfit]= gafitness(psz,n,pop); it is returning only the fist output variable(avgfit).other output variables (pipop,besrfit) are shown as undefined.
I want to know how to modify the function call to return multiple output variables.
3 Comments
madhan ravi
on 6 Nov 2018
upload the full code and the datas required
Jan
on 6 Nov 2018
What does "shown as undefined" mean? Please post the complete error message, if there is one.
Siva
on 6 Nov 2018
Accepted Answer
More Answers (0)
Categories
Find more on Workspace Variables and MAT Files in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!