×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

MATLAB to C

MATLAB to C

MATLAB to C

(OP)
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!
      

RE: MATLAB to C

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
http://www.geocities.com/bstex2001

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources