How to export data from MATLAB to machine language

hey i have just finished writing a code in matlab to run certain machine. how do i export the code from matlab to a language that can be read and executed by any machine?

Answers (2)

deploytool %it will only work if you have the required toolboxes

11 Comments

There is also MATLAB Coder (http://www.mathworks.com/products/matlab-coder/) if you are using the supported subset of the MATLAB language.
how exactly do i use it. I don't really understand the articles i have searched. My code is in a file. An example would be of great help thanks.
For deploytool, you need to get a license for MATLAB Compiler. The documentation has an example: http://www.mathworks.com/help/toolbox/compiler/bsl9c8_.html
For MATLAB Coder, there is an example here: http://www.mathworks.com/help/toolbox/coder/gs/bsumpws-1.html
Is there any other way i can export the data without using the MATLAB coder?
Do you want to export code or data?
If it is data that you are trying to export, then we need to know what data type it is in in your program, and what data type you need it to be in the target machine, and we need to know what the internal representation is for numbers on the target machine (e.g., you might be switching between Little-End integers and Big-End integers, or perhaps the target machine uses only fixed precision decimal arithmetic instead of floating point.)
We would also need to know what kind of file format the target can use to store the values. For example, in order to load the data properly is it necessary to represent it in Motorola S-Block Format, or can we just write a continuous stream of binary data because the target machine _does_ have an equivalent of fread() ?
am exporting code. An example would be the laser tracking demo in the image acquisition toolbox. Am trying to export the code so that it can be used by a motion table to do target tracking.
The Laser Tracking demo is written in MATLAB using functions like videoinput, which are not supported by MATLAB Coder as far as I know. However, you might be able to re-implement the core algorithm using functions that are supported for code generation, and integrate it with your own hardware drivers.
you've left me hanging any more suggestions, because my code is similar to the laser tracking demo just a few changes.
Sorry. Can't think of anything else other than re-implementing. :(
The original answer by Paulo is probably the best choice here. Either use "deploytool" with MATLAB Compiler product or re-implement everything yourself in another language.

Sign in to comment.

The closest you can get to what you actually asked would be to convert the program to a Turing Machine; then to use it on any machine, it would only be necessary to write the appropriate Universal Turing Machine shim appropriate to the Turing Machine implementation on that machine.
Unfortunately, embedded systems often have enough resource restrictions that they would not reasonably be classified as Turing Complete. You are very unlikely to be able to fit your image processing program in to your toaster, for example, and if you did then the "input" to the toaster would probably have to be encoded in moisture levels of the pieces of bread.
Possibly you might be able to get the program to fit on your Digital Watch With The Special Snooze Alarm, but it might be hard to find one of those that still works.

6 Comments

Walter i want to fit the program on a motion table that will have USB camera and a laser pointer on it. How can i do that?
I don't know what hardware exactly would be in a Motion Table, but it seems most likely that you would be wanting MATLAB Coder as referenced by Kaustubha -- if the hardware is a suitable candidate.
The motion table has a computer with Linux as the operating system i was thinking of exporting the code to C++ for it work on the motion table. Do you think it will work or do you have any other way of doing it without necessarily using a MATLAB coder?
What exactly is controlling the motion table? Is there a software that does it? Does it have some C API that could be used to control it? Does it have a data acquisition board that could send voltages to control the table? Or something else?
A software written in c# is controlling the motion table.
Is that a standalone compiled application? Or do you actually have the C# source code that you can modify and integrate your MATLAB application? If it's a standalone, does it provide some kind of API that you can call from outside to send command to the motion table? If it provides some shared library, then you can incorporate that into your MATLAB program (using "loadlibrary") and then compile your application using MATLAB Compiler.

Sign in to comment.

Categories

Asked:

on 18 Apr 2011

Community Treasure Hunt

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

Start Hunting!