Solved

Calling Matlab From C

Posted on 2004-10-14
6
257 Views
Last Modified: 2010-04-15
Hello All,
   I have a prog in C which outputs few arrays... I have worked the C-prog on Visual Studio... The arrays are then loaded into matlab to plot a graph... I don't want to execute 2 programs.. I want to know how can i call a m- file from C. Since studio doesn't support graphics.h, how can i plot???
TIA
-SUma
0
Comment
Question by:hssuma
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 11

Accepted Solution

by:
cjjclifford earned 30 total points
ID: 12306556
its been a while since I've looked at this, but it is possible to generate C code from your M-Code (I've definitely done this), and also vice versa.

using the program "mcc" you can convert .m files to .c files, and then compile these. I'm not sure if this can be done with the graphing engine, I used it before to prototype mathematical models in Matlab, and then compile C code and wrap the resulting library code to a native application... MCC can be used to generate complete application, or just library code, have a look at the documentation...

Also, I think there's been some work with SWIG (interface wrapping software, www.swig.org)...

sorry, as I said, its been a while (3+years!)...
0
 
LVL 45

Expert Comment

by:Kent Olsen
ID: 12312217

Not sure exactly what you're looking for here, but....

Once you write your arrays to files (and close the files) you could use the system() function to run Matlab.


Kent
0
 

Author Comment

by:hssuma
ID: 12316294
Can u plzz elaborate on the system() function...
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you thought about creating an iPhone application (app), but didn't even know where to get started? Here's how: ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Important pre-programming comments: I’ve never tri…
Examines three attack vectors, specifically, the different types of malware used in malicious attacks, web application attacks, and finally, network based attacks.  Concludes by examining the means of securing and protecting critical systems and inf…
The goal of this video is to provide viewers with basic examples to understand how to use strings and some functions related to them in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use switch statements in the C programming language.

710 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question