【发布时间】:2011-03-03 13:29:43
【问题描述】:
这有点重复 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 单元格数组,其中每个原始数组的一个元素位于一个单元格中。
有什么想法吗?
【问题讨论】:
标签: arrays matlab variables variable-assignment