Alex
Alex

Reputation: 27

How to convert m file to c file

I have .m file and I really need to convert it to c language. is there any compiler available to do so? I do really appreciate your helps.

Upvotes: 1

Views: 3997

Answers (2)

Thilo
Thilo

Reputation: 9157

The only way I know of is using Matlab Coder, which is a quite expensive.

If you do not want to spend that money, I fear your best option is to recode the m-file in C. Does it really have to be C or might C++ be enough. Using the eigen library, Matlab code neatly transforms to C++ without to much trouble.

Upvotes: 3

Marco Scannadinari
Marco Scannadinari

Reputation: 1874

There is the Simulink Coder, from Mathworks, but you must purchase it. You can get a trial version for free, though.

See this similar SO question for more details.

Upvotes: 1

Related Questions