Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

MATLAB to C

Status
Not open for further replies.

Maila

Electrical
May 29, 2001
1
I'd like to know how my "file.m" could be useful in a C program; the file.m should return a "file.txt" a number of times equal to a defined value in a "for" loop in the C code.
Example:
output=0;
for(i=0;i<3;i++)
{
result=call to function MATLAB(output);
output=function C(result);
}

I hope to be clear; thank you for your kind answers!
 
Replies continue below

Recommended for you

Hi,
There is no easy way to do it.
1) There is something called 'engine' that enables to slave MATLAB to other applications. I have no experience with that.
2) If you can reverse the problem to call the C program from Matlab then you can
compile it as 'mex' file that you call from MATLAB. In order to do it you have to setup
some files in MATLAB /bin directory to make the right link to your C compiler and then use the 'mex' command from within MATLAB. (>> help mex)
3) Finally for MATLAB 5.3 and higher you can us activeX control. Again I have no experience with it.
Joe
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor