An open API service indexing awesome lists of open source software.

https://github.com/yzhong52/matlab_plot_with_cpp

Use Matlab frunction to draw a plot using C++
https://github.com/yzhong52/matlab_plot_with_cpp

Last synced: 4 months ago
JSON representation

Use Matlab frunction to draw a plot using C++

Awesome Lists containing this project

README

          

Use Matlab frunction to draw a plot using C++
====================

This is a extremely easy demo showing you how to use Matlab function to draw a plot using c++. You will be able to visualize the plot without even opening Matlab window. It will just run in background and show you the plot you need.

====================

Motivation of doing this:
I am using OpenCV and C++ for most of my vision projects because of running speed. However, I really want to utilize Matlab to visualize some of my results, e.g. the histogram of an image. This piece of code become very handy to use because I cam just call Matlab functions from within my C++ project.

====================

This project is build on the following platform:
- Microsoft Visual Studio 2010
- Matlab 2009b

====================

Configuration:

As an example, I am intalled a 32-bit Matlab under location 'C:\Program Files (x86)'.

In Visual Studio, go to Project > Configuration Properties > C/C++ > General Addtional Include Directories and add the following:

C:\Program Files (x86)\MATLAB\R2009a\extern\include

Go to Project > Configuration Properties > C/C++ > General > Addtional Library Directories and add the following:

C:\Program Files (x86)\MATLAB\R2009a\extern\lib\win32\microsoft

Go to Project > Configuration Properties > C/C++ > Input > Addtional Dependencies and add the following static libraries:

libmx.lib libmat.lib libeng.lib