Solved

Calling Matlab From C

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

Independent Software Vendors: 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

Suggested Solutions

Title # Comments Views Activity
How to create frequencies of a variable from SAS dataset? 10 137
How to jump to matching brace in eclipse editor ? 1 353
Grammars for C C++ and java 1 138
Socket Programming (Unix) 8 153
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…
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…
The goal of this video is to provide viewers with basic examples to understand opening and writing to files in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use conditional statements in the C programming language.

735 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