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 211264 articles. 25 followers. lunamoonmoon (257) is leader. Post Follow

6 Replies
2133 Views

Similar Articles

[PageSpeed] 29

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:

Similar Artilces:

Problems calling from Matlab a Matlab compiled dll
Hi, I'm trying to make a dll from an m-file and use the dll function calling from the workspace or from an m file using 2008A version: Step 1 function [output] = addizione (a,b) output = a+b; end Step 2 I compile it with matlab compiler mcc -l addizione I obtain addizione.dll, .lib, .h etc Step 3 load the newly created addizione.dll loadlibrary ('addizione','addizione') with the following warnings: Type 'LARGE_INTEGERPtr' was not found. Defaulting to type voidPtr. Found on line 20522 of input from line 7673 of file C:\Programmi\MATLAB\R2008a\sys\lcc\inclu...

Problems calling from Matlab a Matlab compiled dll #2
Hi, I'm trying to make a dll from an m-file and use the dll function calling from the workspace or from an m file using 2008A version: Step 1 function [output] = addizione (a,b) output = a+b; end Step 2 I compile it with matlab compiler mcc -l addizione I obtain addizione.dll, .lib, .h etc Step 3 load the newly created addizione.dll loadlibrary ('addizione','addizione') with the following warnings: Type 'LARGE_INTEGERPtr' was not found. Defaulting to type voidPtr. Found on line 20522 of input from line 7673 of file C:\Programmi\MATLAB\R2008a\sys\lcc\inclu...

Calling matlab compiled shared library in matlab console
Hi everyone, I wonder if anyone has tried to call a shared library compiled using matlab compiler 4 within matlab? I did this because it is easier to debug within matlab since all my code is in matlab. I can then provide the library for others to use after I fully debug the library. Any help will be appreciated. Thanks. Jerry ...

Problems calling from Matlab a Matlab compiled dll #3
Hi, I'm trying to make a dll from an m-file and use the dll function calling from the workspace or from an m file using 2008A version: Step 1 function [output] = addizione (a,b) output = a+b; end Step 2 I compile it with matlab compiler mcc -l addizione I obtain addizione.dll, .lib, .h etc Step 3 load the newly created addizione.dll loadlibrary ('addizione','addizione') with the following warnings: Type 'LARGE_INTEGERPtr' was not found. Defaulting to type voidPtr. Found on line 20522 of input from line 7673 of file C:\Programmi\MATLAB\R2008a\sys\lcc\inclu...

Calling Matlab in C in Matlab
Hi everybody! My problem can be described as follows. I have a tool in Matlab that requires calling an optimisation algorithm in C. This algorithm consists of several C-files, one of which contains the function to be minimised (CFUNCTION), and another is the main algorithm file (CMAIN). Now what I want to do is to call Matlab from CFUNCTION or CMAIN and specify my custom function (MFUNCTION) to be minimised. So, I'm calling Matlab from C from Matlab. I'm a newbie in C and MEX files. Should I rewrite CMAIN as a MEX file and include CFUNCTION in this and then use mxCallMATLAB? Or can...

I have a m-file that I compiled into a dll using MatLab compiler. I then created a C# library class to call the MatLab dll
hi, >i creat an M-file which has an imagen in file then in matlab i create it dll using >deploytool >Then i include this dll in visual studio 2005 C#.Net project >Then i make a windows form which has a button,picturebox,textbox openfiledialog >what should be the code of button it access the m-file from matlab show its path in >textbox and image in picture box or >what is the procedure of accesing matlab file from C#.Net,plz help me for this >problem immediatley >my code of m-file is function aa %Ori_Face=imread('E:\Shakir\Faisal\Face\sub6.1.jpg'); ...

mex - matlab calls fortran which calls matlab which calls fortran
Dear All, I'm trying to link matlab and fortran with mex files and engine matlab, in linux OS. My general purpose is the following: 1) a matlab script A calls a mex function B based upon fortran source code 2) mex function B calls another function in matlab C within matlab engine 3) matlab routine C calls another mex file in fortran D While i'm able to do steps 2) and 3), I can't do step 1). Before to show the code, please reply to this simple question: Is it possible to build the overall process 1-3? On 8 Okt, 16:37, "Michele Catalano" <cata...@yahoo.it> wr...

MATLAB talking to MATLAB?
For my project, I need to have a client program (MATLAB executable) talking to a server program (also MATLAB executable) to query data. Is there any easy way to accomplish that? I appreciate any help that I can get on that. Thanks. Cheers, Hoi Oops, I forgot to mention. There are multiple clients querying the server, so I guess serial objects + remote serial port wouldn't work. "Hoi Wong" <wonghoi.ee@gmail.com_> wrote in message news:f3ald6$gg4$1@news.Stanford.EDU... > For my project, I need to have a client program (MATLAB executable) > talking to a ser...

matlab calling DLL vs. .exe calling matlab engine
Hello, I'm writing an 3D image recognition which sends commands via RS232 to a Robot which moves to the point in 3D. The problem is the serial interface: sending string commands via serial/fprintf is very slow (I really don't know what matlab makes before sending them) in comparison to e.g. Windows hyperterminal. My question is if it is better to execute a dll out of Matlab-code doing the serial things or viceversus writing a program in c++ which uses the matlab-engine ? What could be the fastest way? What are advantages/disadvantages ? Any help would be appreciated. Thanks in advanc...

Run Matlab ... from Matlab
Hello, Is there any limitation to run Matlab from Matlab, as a system command, on Linux platforms ? I tried to start Matlab, both using the ! syntax (!matlab&) or the system command (system('matlab&')), the Matlab splash screen appears, but the new Matlab session closes rapidly . When I do the same with a script of mine (system('matlab -r "myscript"&')), my script is being executed, but Matlab finally crashes . If I remove the &, it works well, but the first Matlab session is blocked till I close the second one . I run Matlab on a Linux 64bits pla...

Matlab compiler for Matlab 5.2
I'm looking for matlab compiler for matlab 5.2 for Mac computers. I wasn't able to find anywhere because the Mathworks doesn't produce it. Do you know were I may find it? Thanks ...

calling Matlab w/o Matlab
Hi, is it possible to call simple matlab function or a compiled file w/o starting matlab? For example from a VBA code? I don�t mean excel link or creating Matlab as an object. It both require starting Matlab. Is there any way? Thank You You mean, other than buying the MATLAB Compiler, building a DLL, and calling the entry points directly? I don't think so. john. ondrej wrote: > > > Hi, > is it possible to call simple matlab function or a compiled file > w/o > starting matlab? For example from a VBA code? I don�t mean excel > link > or creating Matlab as an objec...

time trial version of matlab compiled code using the matlab compiler
is there any way to create a time trial version of a program compiled using the matlab compiler? ...

How to call matlab functions directly from C++ /without calling matlab engine
How to call matlab functions directly from C++ without calling matlab engine. as it is described in this tutorial: http://www.codeproject.com/samples/matlab_cpp.asp I have tried to do something similar in Visual Studio 2005 [Matlab 7, r14] #include <mclcppclass.h> .... mwArray A, B, C; A = magic(mwArray(5)); B = transpose(A); .... but it doesn't compile. I got following errors: error C3861: 'magic': identifier not found error C3861: 'transpose': identifier not found etc... I was looking for header files with declarations of this functions in matlab directory...

methods to call matlab in C C++ and call C C++ in matlab
Hi, I am reading the help documents about how to program matlab and C C++ together and my questions are a little bit general. It seems that are several ways to call matlab in C C++ and another several ways to call C C++ in matlab. Please correct me if I am wrong or missing something when I try to list them. To call matlab code in C C++, are there two methods available? The first one is Matlab engine and the second one is to use MATLAB Compiler mcc to create C or C++ shared libraries from your MATLAB code. To call C C++ in matlab, are there also two methods? The first one is to call funct...

Eclipse RCP and MATLAB (calling MATLAB from JAVA)
Dear all I need some help about using Eclipse RCP with MATLAB. I want receive input variables from web (probably using Eclipse RCP, I just heard about Eclipse RCP) and calcuate something and generate figure or animation in MATLAB. Finally, send the result to the web and display them using Eclipse RCP. I know about MATLAB Web Server (MWS). However, MWS has some limitation, so I want to combine Eclipse RCP with MATLAB for more compatibility. Could you help me ? The example will be greate help for me. Thanks in advance. ...

Compiled matlab appl. on computer without matlab
Hi, I am very new to Matlab and never used it. Also I don't need to use it directly. However I need to use a compiled matlab application that converts one file into another one (I just call the exe-file). When trying to do so a windows error message pops up (mclmcrrt71.dll can't be found). I guess I have to install matlab, but I was wondering if there is another way? The application will be run on an on-board system and installing matlab seems to be a little bit heavy. Is there another way? Is it maybe possible to compile the matlab program so that it contains all neccessary files/dll...

Call a Matlab function from Java running in matlab.
Hi guys. I really apologize for asking this question, since I'm sure it is either basic or not possible, but I have been reading through the documentation and can't seem to figure this out, since the examples look like they just send and receive variables from the Java methods. Could anyone give me a short example of how to call a method from a Java object that causes some sort of action to be performed in MATLAB? For example, I would like to: 1) make a new object of MyClass from MATLAB called MyObject. 2) run MyObject.DoSomethingInMatlab() 3) have a statement in DoSomethingInMatlab...

Check for matlab error from Matlab Engine call
Hi, I am using the matlab engine from a C++ program. I call engEvalString() and check for the return value, but the result is zero, even if a Matlab error (like "Undefined function or variable '...') occurs. Is there any way to find out if a Matlab error occured? Thanks, Philipp ...

invoking a matlab DLL from a matlab compiled program
Hello: I have developed a compiled version of a matlab program. Now I want to add new functionality but without a new compilation. I have means to modify the callbacks from the old buttons, so I have just have to solve: a) which format/technology to invoke from matlab another compiled (DLL?,COM??) object or alike b) how to pass information from one framework to the other Any hints? Regards Carlos ...

call to matlab function from matlab GUI stalls
I have the following problem. I have created a simple Matlab GUI (for our purposes it can just be considered a Matlab function) which gathers some parameters and then invokes a perl script that in turn calls other perl and Matlab scripts to perform various calculations. If instead of using the Matlab GUI, I run the perl command from the unix prompt, the flow runs and concludes correctly. BUT if I invoke the flow from the Matlab GUI (function), then it runs correctly by calling various other perl and Matlab scripts, but then when it reaches the third Matlab function call, it consistently stalls...

how to call matlab file to another matlab file
Hey friends, i am working on simulation of power system using matlab. for that i have written codes for generation side and line side separately. Now i want to use the result of generation file to line file....so how can i use the result of one file to another.... eg i have gen.m file from that i can get hourly gen data....now i want to compare that data to line.....and line modelling is done in separate file line.m so i want to call result of gen.m file to line.m file..... waiting for ur valuable suggestion thanks ...

matlab beginner: calling matlab from C/C++
I'm relatively new to the world of Matlab. I want to call my matlab own code from a C/C++ program on a machine with matlab installed. Do I need to compile the matlab code using matlab compiler tool or the matlab engine is enough for this? Thanks a lot for your help On Nov 28, 10:03 am, "Paeo Campigotto" <campigo...@dit.unitn.it> wrote: > I'm relatively new to the world of Matlab. > I want to call my matlab own code from a C/C++ program on a > machine with matlab installed. > Do I need to compile the matlab code using matlab compiler > tool or the matla...

Matlab automation server and Matlab Compiler Run Time
I did a simple excel macro which runs matlab functions sucessfully in a machine with Matlab installed. Now I want to run it in a computer without matlab, with "MATLAB Compiler Run Time" installed. I can add the Matlb automation server type file (mlapp.tlb) sucessfully, but when I try to run it, I get this error: "ActiveX component can't create object" In this line: Set matlab = New MLApp.MLApp Do you know what is missing? Thanks ...

Web resources about - Calling Compiled MATLAB from MATLAB - comp.soft-sys.matlab

Microsoft Compiled HTML Help - Wikipedia, the free encyclopedia
Microsoft Compiled HTML Help is a Microsoft proprietary online help format, consisting of a collection of HTML pages, an index and other navigation ...

compiled st - kilda to rosstown extension - Flickr - Photo Sharing!
Explore Cameron Stewart's photos on Flickr. Cameron Stewart has uploaded 431 photos to Flickr.

21 Foot Rule Less Talk and More action (compiled and shortened) - YouTube
http://www.21footrule.com It is one thing to read about the 21 foot rule, it is another to actually see it done. Many times people think that ...

Hillary and Bill Clinton compiled disloyalty 'hit list', new book claims
Hillary and Bill Clinton keep a detailed "hit list" of everyone who has crossed them during more than 20 years at the apex of American politics, ...

Steve Jobs videos compiled into ultimate collection
... New York Times on Twitter, a pretty extensive collection of Steve Jobs’ interviews, keynotes, product demos, and rare company video was compiled ...

NRA compiled secret gun registry on “tens of millions” of gun owners
If you really believe the government is Hitler, then why aren't they capable of stealing the NRA's gun registry? .

All of The Simpsons’ best movie references compiled in one video
After 27 seasons on the air, it only makes sense that The Simpsons would reference every show, movie, book and pop culture artifact that it possibly ...

"Within the past 24 hours, user-contributed link aggregator reddit.com compiled a 'secret list' of banned ...
"... including such reputable news sites as The Atlantic, Business Week, PhysOrg and ScienceDaily." Reddit is a site that claims to be all for ...

Thank goodness the NSA had the sense to put funnyman Art Buchwald on the watch list it compiled for President ...
... which turned to the FBI, and eventually the NSA "expanding the watch list to include domestic terrorist and foreign radical suspects" compiled ...


Resources last updated: 2/29/2016 12:22:31 AM