Matlab编码器;不支持订阅mxArray

时间:2015-05-07 23:52:50

标签: arrays matlab indexing matlab-coder

使用matlab编码器,我在以下函数中出现Subscripting into an mxArray is not supported.错误:

function net = mlpunpak(net, w)
% Check arguments for consistency
errstring = consist(net, 'mlp');
if ~isempty(errstring);
    error(errstring);
end
nin = net.nin;
nhidden = net.nhidden;
nout = net.nout;

mark1 = nin*nhidden;
net.w1 = reshape(w(1:mark1), nin, nhidden);
mark2 = mark1 + nhidden;
net.b1 = reshape(w(mark1 + 1: mark2), 1, nhidden);
mark3 = mark2 + nhidden*nout;
net.w2 = reshape(w(mark2 + 1: mark3), nhidden, nout);
mark4 = mark3 + nout;
net.b2 = reshape(w(mark3 + 1: mark4), 1, nout);'  

我尝试了不同的解决方案,我可以在网上找到,但没有一个工作(例如:使用coder.extrinsic('reshape'),用零初始化net.w1 .... 任何人都知道如何解决这个问题?

0 个答案:

没有答案