[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Odd behaviour with Matlab script
From: |
Mike Miller |
Subject: |
Re: Odd behaviour with Matlab script |
Date: |
Sun, 9 Feb 2014 16:39:41 -0500 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
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