Solved

Calling Matlab From C

Posted on 2004-10-14
6
252 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
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:Kdo
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

This tutorial is posted by Aaron Wojnowski, administrator at SDKExpert.net.  To view more iPhone tutorials, visit www.sdkexpert.net. This is a very simple tutorial on finding the user's current location easily. In this tutorial, you will learn ho…
This is a short and sweet, but (hopefully) to the point article. There seems to be some fundamental misunderstanding about the function prototype for the "main" function in C and C++, more specifically what type this function should return. I see so…
The goal of this video is to provide viewers with basic examples to understand and use structures in the C programming language.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use while-loops in the C programming language.

864 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

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now