help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Running out of memory???


From: Jaroslav Hajek
Subject: Re: Running out of memory???
Date: Thu, 21 Jan 2010 21:42:17 +0100

On Thu, Jan 21, 2010 at 6:05 PM, babelproofreader
<address@hidden> wrote:
>
> Can anyone explain why the script below is failing with error message
>
> error: memory exhausted or requested size too large for range of Octave's
> index type -- trying to return to prompt
>
>
> the script :-
>
> clear
>
> r2_critical_values_5=load("-ascii","r2_critical_values_5");
>
> period = input( "Enter period length for sinewave: " );
> sine_amp = input( "Enter sine amplitude: " );
> trend_inc = input( "Enter incremental trend change: " );
>
> sinevector=zeros(500,1)';
> trendvector=zeros(500,1)';
>
> for ii =2:500
>  sinevector(ii)=sinevector(ii-1)+(360/period);
>  trendvector(ii)=trendvector(ii-1)+trend_inc;
> endfor
>
> original_sine=sine_amp*(sin(sinevector.*(pi/180)));
> trend_plus_sine=trendvector.+original_sine;
>
> x = zeros(1:period)';
> ydep = zeros(1:period)';
> axis = (1:500)';
> slope = zeros(1:500)';
> r2 = zeros(1:500)';
> sig_slope = zeros(1:500)';
>

With John's comment still valid, I think the problem is here. zeros
(1:500) is a nonsense. This requests for more than 10^1000 GB of
memory. I doubt you have that :) See "help zeros"


-- 
RNDr. Jaroslav Hajek, PhD
computing expert & GNU Octave developer
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz



reply via email to

[Prev in Thread] Current Thread [Next in Thread]