How to get source code and object code in MATLAB. Have tried a lot unable to generate the object and source code...

I need to get the Object and Source code in MATLAB. I have tried a lot to generate the same but unable to go about the same. Please guide.

6 Comments

object and source code for what in MATLAB, specifically? If you mean the underlying source of the base product itself, no can do--it's a proprietary product of The Mathworks and all licensing rules include neither reverse engineering nor other such shenanigans to get into the internals.
TMW does distribute m-code files for a large portion of the supplied product as the distribution source but those are also copyrighted and the "compiled" code that is run when an m-file is executed is not available to the end user.
Copying from a website :
Object code is the output of a compiler after it processes source code.
Source code is the version of a computer program as it is originally written (i.e., typed into a computer) by a human in a programming language. A compiler is a specialized program that converts source code into object code.
I have been asked to submit object and source code for a program (software developed) written in MATLAB.
Mathworks has a MATLAB Compiler product, which is fairly expensive (over $US6500). However, Student licenses (and Home licenses) do not have access to that product.
Is there any other way as i dont have MATLAB compiler product.
Yes, if you have MATLAB Coder product instead, and your program fits within the restrictions of MATLAB Coder, then you can use MATLAB Coder to generate C or C++ code that could then be compiled into an executable. MATLAB Coder is available to Students (but not to Home license).
Note: in some cases, it can end up being a fair bit of work to get something to work with MATLAB Coder; in other cases it is easy.
"I have been asked to submit object and source code for a program (software developed) written in MATLAB."
Then whomever made the request should be asked to provide the toolset required for the task.

Sign in to comment.

Answers (2)

Hi Avinav,
I understand that by source code you mean the .m file which you write in your MATLAB editor. It is created by you.
Refer to this link regarding locating your MATLAB files and functions:- https://www.mathworks.com/help/matlab/ref/which.html
Refer to these links regarding compilation and generation of binaries of MATLAB files:-
I have been asked to submit object and source code for a program (software developed) written in MATLAB.
If this is for a homework or other school assignment, you should probably ask the person who gave you that assignment to clarify what exactly they want you to turn in. I could see if they expected students to implement the assignment in a compiled language like C or C++ they might ask for object and source code (both the executable and the source code you used to generate it.) But that distinction doesn't really apply for MATLAB code. In that case, submitting the MATLAB code may be sufficient -- or the person who assigned you this task may tell you they want you to implement it in C or C++.

Categories

Asked:

on 13 Oct 2019

Answered:

on 16 Oct 2019

Community Treasure Hunt

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

Start Hunting!