f



Calling Compiled MATLAB from MATLAB

Hello everyone,

How do I compile MATLAB M files into a form that can then be called
from within the MATLAB interpreter? A roundabout way would seem to be
to (somehow) Turn the matlab code into C (I think mcc does this), then
compile this C code into MEX format and call that. Is there an easier
way? I have the MATLAB compiler, so I just need to know what to do with
it to get this to work.

Thanks in advance,

Sina

0
3/6/2005 3:23:35 AM
comp.soft-sys.matlab 211266 articles. 24 followers. lunamoonmoon (257) is leader. Post Follow

6 Replies
1617 Views

Similar Articles

[PageSpeed] 20

sina.tootoonian wrote:
>
>
> Hello everyone,
>
> How do I compile MATLAB M files into a form that can then be called
> from within the MATLAB interpreter? A roundabout way would seem to
> be
> to (somehow) Turn the matlab code into C (I think mcc does this),
> then
> compile this C code into MEX format and call that. Is there an
> easier
> way? I have the MATLAB compiler, so I just need to know what to do
> with
> it to get this to work.
>
> Thanks in advance,
>
> Sina
>
>

HELP MEX
0
3/6/2005 3:58:40 AM
> HELP MEX

Or, better,

HELP MCC
0
3/6/2005 3:59:24 AM
help pcode

pseudo code is useful to obfuscate code - protect algorithms, yet
still run at full speed and be distributable to other matlab users

sina.tootoonian wrote:
>
>
> Hello everyone,
>
> How do I compile MATLAB M files into a form that can then be called
> from within the MATLAB interpreter? A roundabout way would seem to
> be
> to (somehow) Turn the matlab code into C (I think mcc does this),
> then
> compile this C code into MEX format and call that. Is there an
> easier
> way? I have the MATLAB compiler, so I just need to know what to do
> with
> it to get this to work.
>
> Thanks in advance,
>
> Sina
>
>
0
ah3718 (23)
3/6/2005 8:48:33 AM
The reason why I posted was precisely because HELP MCC (or doc MCC for
that matter) provided no solutions to my problem. All I can find there
is making Stand-Alone applications, which I cannot use because I need
to pass data from my matlab workspace, or shared libraries which I
cannot use because they are not mex libraries and have no mex entry
point. The only mcc option that seemed promising was '-x', but it seems
that it is no longer supported because 'here is no longer any
performance advantage to doing so: the MATLAB JIT accelerates M-files
by default.' So if you know any other ways around this, please let me
know.

Cheers,

Sina

0
3/6/2005 6:28:59 PM
sina.tootoonian wrote:
>
>
> The reason why I posted was precisely because HELP MCC (or doc MCC
> for
> that matter) provided no solutions to my problem. All I can find
> there
> is making Stand-Alone applications, which I cannot use because I
> need
> to pass data from my matlab workspace, or shared libraries which I
> cannot use because they are not mex libraries and have no mex entry
> point. The only mcc option that seemed promising was '-x', but it
> seems
> that it is no longer supported because 'here is no longer any
> performance advantage to doing so: the MATLAB JIT accelerates
> M-files
> by default.' So if you know any other ways around this, please let
> me
> know.
>
> Cheers,
>
> Sina
>
>

If speed is not your purpose, and you don't want a standalone app,
then why do you want to turn your m-file into a MEX? As "ah"
correctly pointed out, encryption can be accomplished easily by
making p-code.
0
3/6/2005 8:10:51 PM
Speed IS my purpose, but I want to avoid vectorizing my code at this
stage because it's still in the development/testing phase and
optimising it would make it difficult to read and debug. Basically I'm
looking for a way of speeding up my unvectorized code which still
allows me to call this code through the interpreter as I need to use
some workspace variables.

Thanks,

Sina

0
3/7/2005 5:10:11 AM
Reply: