help-octave
[Top][All Lists]
Advanced

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

Re: Odd behaviour with Matlab script


From: Lester Anderson
Subject: Re: Odd behaviour with Matlab script
Date: Mon, 10 Feb 2014 09:41:58 +0000

Just tried the code at work now and it works ok up to the point of plotting figure 5 and writing out the inverse grid (black1_boinv.dat)
 
The black1_topooutput.dat is written correctly, and the script gets almost to the end but generates the following (memory problem):
 
octave:2> gravinver_blacksea
truncation =  0.10000
ans = 0
Data sets demeaned
iter =  4
rms =  0.011540
error: memory exhausted or requested size too large for range of Octave's index type -- trying to return to prompt
octave:2>
 
I applied the changes that had been suggested.
 
This is a Windows 7 Enterprise machine with 16Gb of RAM
 
My home machine, where the code runs without issue, is Windows 7 Home premium and on 4 Gb of RAM.
 
I tried a full reinstall of Octave at work, to see if that would solve the problem but it didn't help. Not sure what the problem is.
 
Cheers
Lester


On 9 February 2014 23:08, Lester Anderson <address@hidden> wrote:
Thanks for the info Doug, Mike,

Using real on the mean part of the code seemed to sort it all out for the grids I have. It does seem like large datasets seem to trip over with the fft2 function, but smaller ones are fine.

I have to defer to your judgment on this issue as I am not an expert on Matlab!

Anyway, thanks guys for the guidance - so far all is well and an even larger grid tested fine!

Cheers
Lester


On 9 February 2014 21:39, Mike Miller <address@hidden> wrote:
On Sun, Feb 09, 2014 at 10:20:14 -0500, Doug Stewart wrote:
> On Sun, Feb 9, 2014 at 10:05 AM, Lester Anderson <address@hidden>wrote:
>
> > Hello,
> >
> > I have tried running a Matlab script, which works fine with the deafult
> > data that came with it, but seems to fall over when running real data:
> >
> > octave:5> gravinver_blacksea
> > truncation =  0.10000
> > ans = 0
> > Data sets demeaned
> > error: octave_base_value::array_value(): wrong type argument 'complex
> > matrix'
> > [...]
> > Any ideas what might be wrong?
>
> at line 59  try
> surf(real(mapabou))

Agree with Doug here, the error message clearly indicates that the data
you have passed to surf is complex when it should not be. In particular,
look at the following:

  X = fft2 (rand (830, 1660));
  X(1,1)
  ans =  6.8888e+05 + 3.7215e-11i

where I substituted a random matrix of about the same size as your "bou"
variable. Use real when calculating the mean this way to discard the
imaginary residual. This could be interpreted as a bug in fft2.

HTH,

--
mike



reply via email to

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