Calling Matlab Built-in Functions from Visual Studio
3 views (last 30 days)
Show older comments
Omar Ahmad
on 11 Sep 2011
Commented: PREETHI NAIR
on 22 Feb 2017
Hello,
I'm trying to call Matlab built-in functions (conv, trapz) from a C++ application. I have Matlab R2008b and am using Visual Studio 2008.
I've modified my C++ project to include the Matlab header files and libraries. What do i do next?
For example, here's a piece of code where I'd call trapz next:
vector<float> fn; // do something to fill fn with floats // call matlab trapz(fn) here
0 Comments
Accepted Answer
Kaustubha Govind
on 11 Sep 2011
I would recommend following the MATLAB Engine API documentation and trying out a simple example to help you get started.
1 Comment
PREETHI NAIR
on 22 Feb 2017
Hai Madam, I am Preethi. I am working with VC++ and now I want to use matlab engine. I have an image,and it is partitioned into so many blocks.for processing each blocks, I want to connect matlab.But when I execute the program,it works properly for some blocks.After that matlab engine didnt works and exit my program without any error messages. Mam, I close the engine each time after processing. plz give me any solution.
Thank you.
More Answers (2)
Omar Ahmad
on 22 Sep 2011
1 Comment
Kaustubha Govind
on 23 Sep 2011
I think the DLL should exist in $matlabroot/bin/$arch, where $matlabroot is the MATLAB installation directory and $arch is either win32 or win64. Add this path to the system PATH variable.
Omar Ahmad
on 24 Sep 2011
3 Comments
kanwal preet
on 4 Oct 2016
Hello Sir, could you provide the demo of your program, i want the same, call Matlab functions into VS C++ program.
See Also
Categories
Find more on Application Deployment in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!