How do I assign an index value to a function output?
Using R2014b. I have a function called within a for loop which returns lots of outputs. I want to assign an index value for each output of the function as the loop runs. Something like:
for ind = 1:n
[output1(ind),output2(ind), …] = function(inputs)
end
This doesn’t appear to work (results in an error). Is there an easy way to code this without doing:
output1(ind) = output1;
output2(ind) = output2;
for each variable after the function call?Using R2014b. I have a function called within a for loop which returns lots of outputs. I want to assign an index value for each output of the function as the loop runs. Something like:
for ind = 1:n
[output1(ind),output2(ind), …] = function(inputs)
end
This doesn’t appear to work (results in an error). Is there an easy way to code this without doing:
output1(ind) = output1;
output2(ind) = output2;
for each variable after the function call? Using R2014b. I have a function called within a for loop which returns lots of outputs. I want to assign an index value for each output of the function as the loop runs. Something like:
for ind = 1:n
[output1(ind),output2(ind), …] = function(inputs)
end
This doesn’t appear to work (results in an error). Is there an easy way to code this without doing:
output1(ind) = output1;
output2(ind) = output2;
for each variable after the function call? function output indexing MATLAB Answers — New Questions