0

I have a function taking and returning a list of variables [a,b,c] etc. Because of the layout of the program I've assigned these to a variable as p=[a,b,c] and then iterated through them to set them (because matlab has no for i in [] statement that I can find).

I thus have all the return values set in a list/array p, to return. How do I set them all at once? I tried [a,b,c]=p but that doesn't work; I could manually set them as a=p(1),b=p(2) etc but that seems rather inelegant.

2e0byo
  • 149
  • 1
  • 8

0 Answers0