Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Can we convert simulink *.mdl file to matlab *.m file

2,523 views
Skip to first unread message

Vihang Patil

unread,
Mar 29, 2005, 2:31:56 PM3/29/05
to
Hello
I need to know if anyone knows how to convert Simulink *.mdl file to
*.m file
Please advise.
Thanks
Vihang

ABC

unread,
Mar 30, 2005, 3:18:32 AM3/30/05
to

Hello

Open a .mdl file in a text editor , and you will see whole lot of
oppurtunity to do your task!!

"Vihang Patil" <vihang...@yahoo.com> wrote in message
news:ef007...@webx.raydaftYaTP...

dhruv

unread,
Mar 21, 2009, 1:46:01 AM3/21/09
to
"Vihang Patil" <vihang...@yahoo.com> wrote in message <ef007...@webx.raydaftYaTP>...
hi there i am also finding answer to same question if u have got any answer plz reply me ASAP

Sprinceana

unread,
Jun 11, 2009, 3:24:01 PM6/11/09
to
Go to your mdl file click right select open with and open with a text editor for example notepad.

And then save it to .m extension.

Hope this helps you a little!

There is no dedicated function to make this conversion in matlab as far as I know!

Kranthi Krishna

unread,
Nov 16, 2009, 10:10:20 AM11/16/09
to
I need to generate an .m file (from an .mdl file) which on execution produces the source .mdl file

containing add_block() and all.
http://www.mathworks.com/access/helpdesk/help/toolbox/simulink/slref/bq3cxmi.html

any ideas ?

checker i

unread,
Nov 16, 2009, 11:50:19 AM11/16/09
to
"Kranthi Krishna" <krant...@gmail.com> wrote in message <hdrq0s$ml0$1...@fred.mathworks.com>...

There is no command that will convert a simulink model into a m-file.
Can you be more clear on your question,
If your question is , Can we create a model from a m-file?
Ans: yes, you definetely can do that.

Tim

unread,
Mar 15, 2012, 8:00:28 AM3/15/12
to
"Vihang Patil" <vihang...@yahoo.com> wrote in message <ef007...@webx.raydaftYaTP>...
Using R2012a, the copy/paste or rename doesn’t work. Syntax for Simulink and Matlab are different. The Matlab editor reports some ) as errors. The “ needs to be converted to ‘ in some cases. Embedded data is also checked for syntax and fails.

Hope there’s another way.

Cheers

Tim

Steven_Lord

unread,
Mar 15, 2012, 9:30:29 AM3/15/12
to


"Tim " <tim9...@aol.com> wrote in message
news:jjslks$136$1...@newscl01ah.mathworks.com...
Why exactly are you trying to convert a Simulink model file into a MATLAB
function file?

If you're trying to simulate the model from within another MATLAB function,
use the SIM function as described in the documentation.

http://www.mathworks.com/help/toolbox/simulink/ug/br8i6q8.html

--
Steve Lord
sl...@mathworks.com
To contact Technical Support use the Contact Us link on
http://www.mathworks.com

0 new messages