Solved

Calling Matlab From C

Posted on 2004-10-14
6
258 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

[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

Question has a verified solution.

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

An Outlet in Cocoa is a persistent reference to a GUI control; it connects a property (a variable) to a control.  For example, it is common to create an Outlet for the text field GUI control and change the text that appears in this field via that Ou…
Summary: This tutorial covers some basics of pointer, pointer arithmetic and function pointer. What is a pointer: A pointer is a variable which holds an address. This address might be address of another variable/address of devices/address of fu…
The goal of this video is to provide viewers with basic examples to understand and use pointers 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.

617 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