zzhang2006
asked on
Matlab Function Returning multiple arrays and structures -- how to?
I have the following function which is syntactically fine, but I don't know how to access the "another' vector from the Command Window when the function is run.
function [out,another] = array_passing1(x)
out1 = [13, 17, 505]
out = [[x, 2*x, 3*x]; out1] %a 2D array is returned
another = [7,8, 9] % Is this returned? How to access it?
end
--------- Command Window -------------------------- ---------- --
col = array_passing(2)
>> size(col)
ans =
2 3 this is the dimension of the "out", But how can I access the "another"
Thanks for the help!
function [out,another] = array_passing1(x)
out1 = [13, 17, 505]
out = [[x, 2*x, 3*x]; out1] %a 2D array is returned
another = [7,8, 9] % Is this returned? How to access it?
end
--------- Command Window --------------------------
col = array_passing(2)
>> size(col)
ans =
2 3 this is the dimension of the "out", But how can I access the "another"
Thanks for the help!
[col, another] = array_passing(2)
ASKER
Exactly! Thanks
Ze
Ze
This question needs an answer!
Become an EE member today
7 DAY FREE TRIALMembers can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.