fbpx

How C++ call Matlab functions

(Last Updated On: October 27, 2015)

 

How C++ call Matlab functions

Follow these instructions as example

Call MATLAB Functions from C/C++ Applications
  1. To see engdemo.c , open this file in MATLAB® Editor.
  2. To see the Windows version engwindemo.c , open this file.
  3. There is a C++ version of engdemo in the matlabroot \extern\examples\eng_mat folder. To see engdemo.cpp , open this file

http://www.mathworks.com/help/matlab/cc-mx-matrix-library.html

http://www.mathworks.com/help/matlab/matlab_external/calling-matlab-software-from-a-c-application.html

 

This was suggested by Alex at https://alexabosi.wordpress.com/

 

Well, I included the ‘fstream’ header file to print numbers to .txt so I could quickly check the outputs as I worked.
Something like:
float Best_Bid; // defined earlier
std::ofstream bid_output(“bid_output.txt”);
while (/*conditions*/)
{
  /*calculate best bid/ask*/ 
  bid_output << Best_Bid << std::endl;
}

Join my FREE newsletter to see how I accomplish this 

NOTE I now post my TRADING ALERTS into my personal FACEBOOK ACCOUNT and TWITTER. Don't worry as I don't post stupid cat videos or what I eat!
Don't miss out!
Get my TRADE LIKE A BOSS 2 PDF Books

You will received instantly the download links.

Invalid email address
Give it a try. You can unsubscribe at any time.

NOTE!

Check NEW site on stock forex and ETF analysis and automation

Scroll to Top