Is there any way to cross compile a Matlab code into a C code ? the end purpoese is to cross compile that C code to assembly language code targeted for a PIC microcontroller say 16F877 , 30F4011 etc. Or is it a very absurd idea all together??
Matlab to C cross complier
Jan 24, 2007
2 Replies
No. At least not that I'm aware of, and I'd be surprised if there were -- Matlab is a somewhat-object-oriented "language" with a lot of higher function objects (matrices and complex numbers) than what C provides. Converting Matlab to C would require a large support library and undoubedly look pretty ugly.
There is a Matlab compiler, and you can *link* to compiled Matlab code from C... but the output is only usable on the targets that Matlab runs on (x86 and ???) -- definitely not PICs.
Probably. Matlab is a high-enough level language that even if you could generate C code from an arbitrary .m file, it would tend to run inefficiently and occupy a huge amount of code space (relative to what's available).
There are some individual *toolkits* for Matlab that generate C code, I believe... stuff like the DSP filter design kit.
---Joel Kolstad
I think your last sentence might be correct ;-) So let me suggest another idea: 1. MatLab can be translated very simple to Python 2. there exists a Python version for PICs
cheers, Stef Mientki
Join the Discussion
Have something to add? Share your thoughts — no account required.
Didn't find your answer?
Ask the community — no account required