|
From: | Lester Anderson |
Subject: | Re: Odd behaviour with Matlab script |
Date: | Mon, 10 Feb 2014 09:41:58 +0000 |
LesterCheersThanks 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!
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 tryAgree with Doug here, the error message clearly indicates that the data
> surf(real(mapabou))
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
[Prev in Thread] | Current Thread | [Next in Thread] |