这与this question,this question和this question有点重复,但这些解决方案不起作用,所以我问我的。
我有一组本地定义的类,我想将它分配给多个单独的变量。这种模式不起作用:
%a is 2x1 of MyClass
temp = mat2cell(a);
[x,y] = temp{:};
%throws:
??? Insufficient number of outputs from right hand side of equal sign to satisfy assignment.
因为temp
是一个单元格,而我的2x1数组在一个单元格中,而不是一个2x1单元格数组,每个单元格中包含一个元素。
有什么想法吗?
答案 0 :(得分:3)