How do I compile MATLAB files that call Neural Network Toolbox functions into stand-alone applications, in MATLAB releases R13 or older? I would like to generate a stand-alone application from MATLAB code that uses the Neural Network Toolbox. Is it possible with MATLAB Compiler 3.0 (R13)?
Prashant Kumar answered .
2025-11-20
P = [0 1 2 3 4 5 6 7 8 9 10];
T = [0 1 2 3 4 3 2 1 2 3 4];
% Before training, use the following code
net = newff([0 10],[5 1],{'tansig' 'purelin'});
Y = sim(net,P);
plot(P,T,P,Y,'o')
net.trainParam.epochs = 50; net = train(net,P,T); Y = sim(net,P); plot(P,T,P,Y,'o') %%Using GENSIM gensim(net)
t=[0:10]; u=ones(1,11); tu=[t;u]; save newfrom.mat tu;
Suppose we want to tune only the following weight:
my_neuralnet/Neural Network/Layer 1/IW{1,1}/IW{1,1}(1,:)'
So we go to this Constant block and change the value to a symbolic value, say "Pooh". Then we need to inline parameters and configure Pooh as a tunable parameter. Then we need to build the model. To change Pooh to 100, you can simply use the following:
pooh = 100;
myrtp = rsimgetrtp('my_neuralnet');
save myparamfile myrtp;
!my_neuralnet -p myparamfile.mat