4

I have generated a network with MATLAB. I can see the result of this network for my inputs in MATLAB via this command:

sim(net, 0.01)

I want to do this work in C++ with the "net" generated by MATLAB. How can I do this?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Pooria Kaviani
  • 748
  • 1
  • 8
  • 17
  • 2
    possible duplicate of [matlab neural network toolbox](http://stackoverflow.com/questions/5192165/matlab-neural-network-toolbox) – Amro Jun 02 '12 at 16:12
  • 1
    Also see: [Is it possible to compile MATLAB files that call Neural Network Toolbox functions into stand-alone applications?](http://www.mathworks.com/support/solutions/en/data/1-19HN4/index.html?product=NN), and [Neural Networks Functions Convert to C++ codes](http://www.mathworks.com/matlabcentral/answers/32980-neural-networks-functions-convert-to-c-codes) – Amro Jun 02 '12 at 16:16
  • C/C++ Perceptron: http://sourceforge.net/projects/ccperceptron/ – SomethingSomething Oct 16 '14 at 22:45

1 Answers1

1

If you can generate a Simulink model of the network then you can export your network to the C language (like Exporting Neural Network to C++), it's simple. But I do not think this method will be good to use a neural network for other programs.

To me the better solution is to use of the neural network formula (like in Try to simulate a neural network in MATLAB by myself) and use of weights of network that exports from trained network in MATLAB be used in your own program, because it's easy and clean.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
sorosh_sabz
  • 2,356
  • 2
  • 32
  • 53