Reverse Engineering for matlab code?
Show older comments
Hi,
I want to create a flow diagram for my matlab code. Is there a tool out there which can do reverse engineering and help create the flow diagram?
Thanks
12 Comments
José-Luis
on 1 Oct 2014
I don't get it. Matlab is not a compiled language. What do you mean by reverse-engineer? Don't you have the .m file?
dpb
on 1 Oct 2014
Not aware of one, but do a search at the File Exchange and see if are any submissions there...leftmost link at top of this page...
Neesha
on 1 Oct 2014
David Young
on 1 Oct 2014
Edited: David Young
on 1 Oct 2014
José-Luis: MATLAB is a compiled language. But Neesha wants, I think, to reverse-engineer from the m-file to a more abstract or graphical description.
Guillaume
on 1 Oct 2014
That page actually confirms what I said, It does say that C# is compiled to bytecode (proper name is CIL). It also kind of contradict itself, as it categorises that as hybrid higher up.
dpb
on 1 Oct 2014
It's a murky page at best. The best imo portion of it is at the very top where it says a combination of both solutions is also increasingly common: a compiler can translate the source code into some intermediate form (often called bytecode), which is then passed to an interpreter which executes it.
In my book that is still not really "compiled" and by that definition Matlab is one of those and doesn't qualify as a compiled language (and I note it's not in the list on down of those the article claims are altho I've some serious objections with quite a few on the list for the same reason).
This discussion is verging to semantics. I would normally leave it at that, but I am frustrated trying to decipher some Fortran code plagued with globals so I'll keep on arguing.
Whether you are right or wrong depends on how you define things. I have always understood a compiled language to be one that directly transforms text to machine code, using a compiler. Ergo not Matlab. Ergo not even C# as CIL is not machine code and needs another step of translation.
Matlab is, at most, an hybrid between interpreted and compiled. Just try running Matlab without the Java runtime.
Anyway, this all depends on how you define things and is way beyond the scope of what the OP asked.
dpb
on 1 Oct 2014
I agree completely with your version of semantics...fwiw which ain't a lot! :)
For Fortran, look at the Understand for Fortran product from SciTools https://scitools.com/. I've successfully used it on grossly sphaghettified code. It's pricey, but they have a fully functional demo that you can use on a single project for like 15 day or so which is generally enough with it to get thru the rough patches on anything that isn't truly humongous in size.
José-Luis
on 2 Oct 2014
Thanks for the tip. I'll check it out.
Answers (0)
Categories
Find more on Startup and Shutdown in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!