I’m trying to write a Matlab code that, given a matrix, outputs 3 matrices (according to some rules). I’m having difficulty getting this to work though – I can’t output a vector with matrices as entries. I get the error message:
??? In an assignment A(I) = B, the number of elements in B and I
must be the same.
How can I go about doing this?
You could write
and call it with
If you won’t want all of the outputs, just call it with
or
to get just the first argument, or just the first two arguments.