【发布时间】:2019-01-05 16:32:30
【问题描述】:
我是 matlab 新手,无法将对象添加到数组中:
%g is a transfer function
h = bodeplot(g);
% class('h') prints 'resppack.bodeplot'
a = zeros(2,1);
a(1,1) = h;
% I get the error: Conversion to double from resppack.bodeplot is not possible.
发生这种情况是因为我的矩阵 'a' 是 double 类型,而 'h' 不是。 如何定义“resppack.bodeplot”类型的数组? resppack.bodeplot 没有“空”方法...
【问题讨论】:
-
你为什么要这样做?顺便说一句,您可以为此使用元胞数组
标签: arrays matlab object types add