Re: a standalone application from matlab compiler?
- From: "HIu " <sealights30@xxxxxxxxx>
- Date: Thu, 30 Aug 2007 19:13:26 +0000 (UTC)
I agree with you that with large dataset, a 64-bit computer
is the go, in order to save all those hassles. Many thanks!
roberson@xxxxxxxxxxxxxxxxxx (Walter Roberson) wrote in
message <fb0amj$sv7$1@xxxxxxxxxxxxxxxxxxxxxxx>...
In article <fb029m$pe3$1@xxxxxxxxxxxxxxxxxx>,Windows terms)
HIu <sealights30@xxxxxxxxx> wrote:
I recently used the Matlab compiler to generate a standalone
exe file. The dataset is large and Matlab can not read in
the large dataset. Therefore I use the Matlab compiler to
create a standalone .exe file. Use the .exe file, I can read
in the dataset but at some step in processing the dataset,
the program is broken saying that "Out of memory" and
"MATLAB:nomem". I am quite confused. The standalone .exe
file, as the name implies, should not rely on the Matlab
when running and thus I donot understand why the problem is
Matlab related.
function main
load('D:\purch.dat');
t2=clock;
pmean=mean(purch)
t3=clock;
tmean=etime(t3,t2)
psize=size(purch(:,2:16))
When matlab produces an executable, it does not compile in
the code for each of the matlab functions you use (or
which those functions call upon to do portions of the work).
Instead, matlab uses a fixed shared library (.dll in
which contains all of the core matlab routines, and thea copy
compiled executable calls into the shared library at need.
After I used mcc to compile the M file to a .exe file and
run the .exe file under the DOS command Prompt, I got the
following message:
tmean=
187.1410
??? Out of memory. Type HELP MEMORY for your options
Error in ==> wm at 9
(I note: the 9th line is psize=size(purch(:,2:16))
MATLAB:nomem
If memory is short, why would you take a size like that???
size(purch(:,2:16)) is going to be the same as
[size(purch,1), size(2:16,2)] which is going to be the same as
[size(purch,1), 15].
When you do it the way you have coded, Matlab has to take
columns 2 thru 16 of all of the rows of purch, and thenrun the
size() operator on the result (and then throws away thetemporary copy.)
If you code it the way I show, as [size(purch,1),size(2:16,2)]
or [size(purch,1), 15] then Matlab will not need to take acopy
of the data at all, and the statement will not run out ofmemory.
new? It hath
With that change, you probably wouldn't even run out of memory
in a plain .m file (unless later code chews up memory.)
--
Is there any thing whereof it may be said, See, this is
been already of old time, which was before us. --Ecclesiastes
.
- References:
- a standalone application from matlab compiler?
- From: HIu
- Re: a standalone application from matlab compiler?
- From: Walter Roberson
- a standalone application from matlab compiler?
- Prev by Date: Re: simultaneous equations
- Next by Date: Saving large MAT file as a tab delimited text file
- Previous by thread: Re: a standalone application from matlab compiler?
- Next by thread: quadprog help
- Index(es):
Relevant Pages
|