Is there anything like deal() for normal MATLAB arrays? [duplicate] Is there anything like deal() for normal MATLAB arrays? [duplicate] arrays arrays

Is there anything like deal() for normal MATLAB arrays? [duplicate]


One option is to convert your array to a cell array first using NUM2CELL:

myArray = [1, 2, 3];cArray = num2cell(myArray);[a, b, c] = cArray{:};

As you note, you don't even need to use DEAL to distribute the cell contents.


Not terribly pretty, but:

myArray = 1:3;c = arrayfun(@(x) x, myArray , 'UniformOutput', false); c{:}