How to run an m-file in MATLAB from Visual Studio in C code

3 views (last 30 days)
I have an application running in Visual Studio 2010, written in C code. I need to start the Matlab and run a specific m-file inside my code. I have successfully used the engwindemo code, but it does not meet my needs.
Best Regards, Vlad Muresan
  2 Comments
Kaustubha Govind
Kaustubha Govind on 23 Jul 2012
Vlad: Could you explain how it does not meet your needs, so we know exactly what you're looking for?
Vlad Muresan
Vlad Muresan on 23 Jul 2012
I want inside my c-code in Visual Studio to start the Matlab and run an m-file, then close it. This means that Matlab will work like an external server which performs some calculations.
As far as I saw, the engwindemo just use the Matlab to plot some values but I've found no commands in the library that can run an m-file. Thanks

Sign in to comment.

Accepted Answer

Titus Edelhofer
Titus Edelhofer on 23 Jul 2012
Hi Vlad,
the command engEvalString evaluates a string in the engine. This string may simply be the name of a function or script to be called (needs to be on the path of course)...
Titus
  1 Comment
Vlad Muresan
Vlad Muresan on 23 Jul 2012
Thanks for the answer, could you give me please more details how the command will look in this situation?

Sign in to comment.

More Answers (0)

Categories

Find more on App Building in Help Center and File Exchange

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!