How Can I convert Matlab code to "C language" or "C++ language"??

I have generated my model using Neural Networks and SVM. Now i want to transform that Matlab code to C language for deployment in practical hardware.

댓글 수: 4

Have you tried the automatic code generation? If you already have a simulink model, may be you can generate a c-code from it (Just a thought, I've never tried it before). Also, since you've already finished the model, got your weights and layers and so,, may be you can use this data directly to write it in c-code? Another thought, cheers.
Is it a Simulink model or is it MATLAB code?
MATLAB code.I have Generated Code/Script from Neural Network app.I want to transform this code/script this script to C code.
% % Solve a Pattern Recognition Problem with a Neural Network
% This script assumes these variables are defined:
%
% irisInputs - input data.
% irisTargets - target data.
x = irisInputs;
t = irisTargets;
% Choose a Training Function
trainFcn = 'trainscg'; % Scaled conjugate gradient backpropagation.
% Create a Pattern Recognition Network
hiddenLayerSize = 10;
net = patternnet(hiddenLayerSize);
% Setup Division of Data for Training, Validation, Testing
net.divideParam.trainRatio = 70/100;
net.divideParam.valRatio = 15/100;
net.divideParam.testRatio = 15/100;
% Train the Network
[net,tr] = train(net,x,t);
% Test the Network
y = net(x);
e = gsubtract(t,y);
performance = perform(net,t,y)
tind = vec2ind(t);
yind = vec2ind(y);
percentErrors = sum(tind ~= yind)/numel(tind);
% View the Network
view(net)
This guy gave the most detailed answer to exactly what you want: C/C++ code from Matlab NN

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

도움말 센터File Exchange에서 Deep Learning Toolbox에 대해 자세히 알아보기

제품

질문:

2016년 10월 27일

댓글:

2016년 10월 27일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by