Is there anything like deal() for normal MATLAB arrays?
Posted
by jjkparker
on Stack Overflow
See other posts from Stack Overflow
or by jjkparker
Published on 2010-04-29T20:53:01Z
Indexed on
2010/04/29
20:57 UTC
Read the original article
Hit count: 269
matlab
When dealing with cell arrays, I can use the deal()
function to assign cells to output variables, such as:
[a, b, c] = deal(myCell{:});
or just:
[a, b, c] = myCell{:};
I would like to do the same thing for a simple array, such as:
myArray = [1, 2, 3];
[a, b, c] = deal(myArray(:));
But this doesn't work. What's the alternative?
© Stack Overflow or respective owner