Question: I used the matlab neural network to train on some data but I want to run this neural network in c++ program,how to do that?

Answer: 
You can use the Matlab Compiler that generates code you can embed in your C++ application
I'm using Matlab R2013a. If you are still facing with this issue, try to look at this location

```
Matlab\R2013a\toolbox\nnet\nnet\nnderivative\+nnMex2

```

inside Matlab directory. I found there file "yy.cpp" which contains `mexFunction` which does the thing. Very likely that Matlab calls this function to simulate network.

Seems that it's possible to integrate this function into your project after slight refactoring. At least I plan to do so. :-)