How to Convert a matlab .m extension file to hex file or c file?

I have done my programing code in comparing single image with multiple images and obtained the desired out put. Now i want to convert that matlab '.m' file code into Hex file or c file. so that i can start simulating the prototype. I have very short period of time so plz take some time in answering the question.
Thanks

15 Comments

What do you expect as output of a conversion to a HEX file? This usually means that each 8 bit value of a data stream is converted to a 2 character hexadecimal string. But how yould this be helpful for "start simulation the prototype"?
Jan simson first i would like to thank you for taking some time to pick some answer for my question.
My problem is i would like to build a prototype that compares a single image with multiple image and would give me the output audio of the matched file name.and am just ready with the code that does the process.so now i need to build the prototype so what should i do now?
Re: "I have very short period of time so plz take some time in answering the question." We also have very short time periods that we can answer questions, so I ask YOU to take some time in phrasing your question. I have no idea what you want other than maybe you want your computer to pronounce the filename through your speakers (if that's what "give me the output audio of the matched file name" means).
my problem not with the sound or any other.i want to convert matlab code to c file.hope now u understands better?
At least I do not understand, because I do not know, what you exactly mean by "prototype". It is a good idea to avoid mentioning details, which do not have any connection to your problem. Neither sound, nor image comparison nor the filenames do matter. Does this summary match your need: "I have some M-files and want to convert them to C-code, such that it can be compiled by the XYZ-compiler"?
If so, does Wayne Kong's answer solve the porblem already? If not, what is missing?
yeah,but i need to buy the matlab coder.which i couldn't right now.
is there chat option on this mathworks?
@Wayne: Sorry, of course Wayne King, not Kong. Not funny.
@Pradeep: If you cannot buy the Matlab coder, why do you want to do this in Matlab? Without having the necessary tools, you have to create the program in C.
What is an "chat option on this mathworks"? Do you want to call an employee of MathWorks by phone?
i cannot buy matlab coder right now.it meant i would like to know an alternate method in converting the Matlab code to c file if any exists.
And "Chat option in this mathworks",this meant i would like to chat to u directly so that it would be effective in solving the problem.
There is no chat option on the MATLAB web site.
If you need to generate C code from your .m file, then MATLAB Coder is the only option I know of.
See also this older discussion: http://www.mathworks.es/matlabcentral/newsreader/view_thread/158966
thx for the link and i found that matlab coder comes inbuilt with r2011a version.is that true?
Sorry, No, that is not correct. "MATLAB Coder" is a new name for a continuation of older products; the new name (and capabilities) were introduced with the R2011a release, but it is still an option extra-cost (and fairly costly) toolbox.
Hi, walter Roberson. How about using alternative softwares like octave and scilab.. Can I use them and convert the .mfile into .hex file. Is that an alternate method apart from matlab coder? Thank you for helping..
I have not heard that octave or scilab have advanced as far as having a coder, but I do not follow them so I do not know.
Oh! I see. Any way Thankyou for your inputs Walter. YOu have been a great help!

Sign in to comment.

 Accepted Answer

Hi, MATLAB Coder generates C or C++ code from your MATLAB code.

1 Comment

Hi, wayne. Can we use alternative softwares like octave and scilab inorder to convert the .mfile to .hex file apart from matlab coder. Please help. I have done with the code but cant afford matlab coder as it is a costly tool.. Please help..

Sign in to comment.

More Answers (2)

The big problem seems that you cannot afford the coder. I am assuming this is an academic project (but the strategy probably holds for commercial ventures). Can you (or your supervisor) bring in a collaborator who is willing to trade authorship or ownership stake for access to the coder?

1 Comment

Yes, This is an academic project done in our own interest. We wrote a program in matlab but we are unable to convert the .mfile to .hex file. We are just working out whether octave an alternative software for matlab would convert the .mfile to .hex file. If you know any information about this please help? Thanks in advance.

Sign in to comment.

hello,
i want to generate embedded c code from matlab code. plz help me

2 Comments

https://www.mathworks.com/matlabcentral/answers/12091-difference-between-simulink-coder-embedded-coder-and-matlab-coder
(this has also been posted as a separate question)

Sign in to comment.

Categories

Find more on Convert Image Type in Help Center and File Exchange

Asked:

on 25 Sep 2011

Commented:

Rik
on 14 Jan 2022

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!