Function returning two vectors
Show older comments
Couldn't really find anything on google by searching for 'functions' and 'vectors' etc, so I'll try here.
If I needed a function returning two vectors (of different size), like this:
[vec1, vec2] = functionname(variables,...)
what is the best approach? If I try to transpose them I get an error since the dimensions don't agree, and if I return them as a vector that would make it difficult to get all the elements (unless there is some trick I have not thought about). Both vectors are about 50 elements long.
Thanks.
Accepted Answer
More Answers (1)
TheFarmer
on 5 Jun 2011
0 votes
Categories
Find more on Language Fundamentals 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!