Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Invoke M-File dynamically in MATLAB standalone
Replies: 1   Last Post: Feb 14, 2013 2:42 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Steven Lord

Posts: 17,944
Registered: 12/7/04
Re: Invoke M-File dynamically in MATLAB standalone
Posted: Feb 14, 2013 2:42 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply



"Jens " <alpha60@freenet.de> wrote in message
news:kfj7du$hog$1@newscl01ah.mathworks.com...
> Dear all,
>
> i just want to know if it is possible to invoke Matlab scripts or function
> within an m-file dynamically into an existing standalone tool, which is
> compiled with the deploymenttool of MATLAB itself?


You mean run a script or function that was NOT compiled into the application
but was created or specified later? No, this is not possible.

http://www.mathworks.com/help/compiler/writing-deployable-matlab-code.html

As that page says, if you want (for example) your application's users to be
able to run myfunction1 or myfunction2 based on the choices they make at
runtime, you need to include both myfunction1 and myfunction2 in your
deployed application when it is created. You cannot include myfunction1 but
let the user create myfunction2 and somehow make it available to the
application at runtime.


If you mean you want to create functions myfunction1, myfunction2,
myfunction3, ... myfunction1000 and let the user choose which to invoke
without explicitly writing all 1000 different calls, I believe that should
be possible by explicitly including the functions in the application then
using STR2FUNC to generate a function handle that is then called like any
other function handle. [Personally I'd almost certainly make ONE function
that accepts a number between 1 and 1000 rather than having 1000 individual
functions, but your use case may differ.]

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




Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.