Using matlab coder, I get Subscripting into an mxArray is not supported. error in the following function:
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);'
I tried different solutions that I could find on the net but none of them worked (like: using coder.extrinsic('reshape'), initializing net.w1 with zeros ....)
Anyone has any idea how to fix this?
mxArrayvalues (i.e. the output of extrinsic calls) to known types likedoubleorint32. This answer also describes the situation.mxArraytype shows up from return values from functions declared extrinsic. The answer he cites will show you how to make sure those variables are properly typed so you can use them.