[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Bug / compatibility any way to work around?
From: |
c. |
Subject: |
Re: Bug / compatibility any way to work around? |
Date: |
Tue, 4 Nov 2014 15:34:21 +0100 |
On 4 Nov 2014, at 15:26, RT <address@hidden> wrote:
> Bug / compatibility problem . I'm using octave 3.8.1 on ubuntu 14.04 64 bit
> the code below works in matlab but I get an error when run with octave does
> anyone know a workaround?
>
> The error that comes back is
> error: octave_base_value::array_value(): wrong type argument 'complex matrix'
> error: called from:
>
> which is an error in the set(handle, 'YData', f(x, b)) % set new y-data in
> plot handle line
>
Is it correct that your function 'f' returns complex values?
You cannot represent complex value as ydata in a 2d plot, what
is it that you intend to plot as 'ydata' in your plot, the absolute
value of 'f(x, b)' or the real part?
Use either
set(handle, 'YData', abs (f(x, b)))
or
set(handle, 'YData', real (f(x, b)))
c.