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: Sun, 9 Feb 2014 23:08:45 +0000

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]