Skip to Main Content Skip to Search
Login
File Exchange
MATLAB Newsgroup
Link Exchange
  Blogs  
 Contest 
MathWorks.com

Thread Subject: overcoming the limit of repmat

Subject: overcoming the limit of repmat

From: Sourav Roy

Date: 07 May, 2008 03:43:03

Message: 1 of 4

Hi,
I tried the below code :-
>> z = rand(1,(666),10000);
>> x = repmat(z,300,1);

The code gave the below error:-

??? Maximum variable size allowed by the program is
exceeded.

Error in ==> repmat at 97
    B = A(subs{:});

While this one worked,

>> ab = z(:,:,1);
>> z = rand(1,(666),100);
>> x = repmat(z,300,1);

Kindly suggest how I can overcome this.

Subject: Re: overcoming the limit of repmat

From: helper

Date: 07 May, 2008 04:03:02

Message: 2 of 4

"Sourav Roy" <souravroy1@rediffmail.com> wrote in message
<fvr8g7$sep$1@fred.mathworks.com>...
> Hi,
> I tried the below code :-
> >> z = rand(1,(666),10000);
> >> x = repmat(z,300,1);
>
> The code gave the below error:-
>
> ??? Maximum variable size allowed by the program is
> exceeded.
>
> Error in ==> repmat at 97
> B = A(subs{:});
>
> While this one worked,
>
> >> ab = z(:,:,1);
> >> z = rand(1,(666),100);
> >> x = repmat(z,300,1);
>
> Kindly suggest how I can overcome this.

You are trying to create a 300-by-666-by-10000 matrix of
double precision (8 byte) values. This requires
300*666*10000*8/1024^3 = 14.88 GB of memory. It ain't
gonna happen with 32-bit MATLAB. Check out the following
technical note:

http://www.mathworks.com/support/tech-notes/1100/1106.html

Get 64-bit MATLAB and a 64-bit machine.

By the way... love the tags "matlab" and "code".


Subject: Re: overcoming the limit of repmat

From: Sourav Roy

Date: 07 May, 2008 04:43:03

Message: 3 of 4

"helper " <spamless@nospam.com> wrote in message
<fvr9lm$nkk$1@fred.mathworks.com>...
> "Sourav Roy" <souravroy1@rediffmail.com> wrote in message
> <fvr8g7$sep$1@fred.mathworks.com>...
> > Hi,
> > I tried the below code :-
> > >> z = rand(1,(666),10000);
> > >> x = repmat(z,300,1);
> >
> > The code gave the below error:-
> >
> > ??? Maximum variable size allowed by the program is
> > exceeded.
> >
> > Error in ==> repmat at 97
> > B = A(subs{:});
> >
> > While this one worked,
> >
> > >> ab = z(:,:,1);
> > >> z = rand(1,(666),100);
> > >> x = repmat(z,300,1);
> >
> > Kindly suggest how I can overcome this.
>
> You are trying to create a 300-by-666-by-10000 matrix of
> double precision (8 byte) values. This requires
> 300*666*10000*8/1024^3 = 14.88 GB of memory. It ain't
> gonna happen with 32-bit MATLAB. Check out the following
> technical note:
>
> http://www.mathworks.com/support/tech-notes/1100/1106.html
>
> Get 64-bit MATLAB and a 64-bit machine.
>
> By the way... love the tags "matlab" and "code".
>
>
Thakns Helper,
I have realised that, just exporing how to go about doing
this .

Subject: Re: overcoming the limit of repmat

From: Loren Shure

Date: 07 May, 2008 12:06:00

Message: 4 of 4

In article <fvr9lm$nkk$1@fred.mathworks.com>, spamless@nospam.com
says...
> "Sourav Roy" <souravroy1@rediffmail.com> wrote in message
> <fvr8g7$sep$1@fred.mathworks.com>...
> > Hi,
> > I tried the below code :-
> > >> z = rand(1,(666),10000);
> > >> x = repmat(z,300,1);
> >
> > The code gave the below error:-
> >
> > ??? Maximum variable size allowed by the program is
> > exceeded.
> >
> > Error in ==> repmat at 97
> > B = A(subs{:});
> >
> > While this one worked,
> >
> > >> ab = z(:,:,1);
> > >> z = rand(1,(666),100);
> > >> x = repmat(z,300,1);
> >
> > Kindly suggest how I can overcome this.
>
> You are trying to create a 300-by-666-by-10000 matrix of
> double precision (8 byte) values. This requires
> 300*666*10000*8/1024^3 = 14.88 GB of memory. It ain't
> gonna happen with 32-bit MATLAB. Check out the following
> technical note:
>
> http://www.mathworks.com/support/tech-notes/1100/1106.html
>
> Get 64-bit MATLAB and a 64-bit machine.
>
> By the way... love the tags "matlab" and "code".
>
>
>

Depending on what you are ultimately trying to achieve, you might be
able to circumvent repmat and still get useful results using bsxfun.
--
Loren
http://blogs.mathworks.com/loren/

Tags for this Thread

Everyone's Tags:

code(2), matlab(2)

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
matlab DS 07 May, 2008 08:52:24
code DS 07 May, 2008 08:52:19
code Sourav Roy 06 May, 2008 23:45:06
matlab Sourav Roy 06 May, 2008 23:45:06
rssFeed for this Thread

envelope graphic E-mail this page to a colleague

Public Submission Policy
NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Disclaimer prior to use.
Related Topics