Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • 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
Joined
May 29, 2001
Messages
1
Location
IT
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!
 
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

Back
Top