octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #43527] Bug / compatibility to plotting any wa


From: Rick T
Subject: [Octave-bug-tracker] [bug #43527] Bug / compatibility to plotting any way to work around
Date: Tue, 04 Nov 2014 14:35:30 +0000
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:33.0) Gecko/20100101 Firefox/33.0

URL:
  <http://savannah.gnu.org/bugs/?43527>

                 Summary: Bug / compatibility to plotting any way to work
around
                 Project: GNU Octave
            Submitted by: ratulloch
            Submitted on: Tue 04 Nov 2014 02:35:29 PM GMT
                Category: Plotting
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: None
                  Status: None
             Assigned to: None
         Originator Name: Rick T
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 3.8.1
        Operating System: GNU/Linux

    _______________________________________________________

Details:

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 3.8.1
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


Code below:



% // Parameter and x-range

m=3.73;

a=480;

r=1;

fs=44100;

x=linspace(0,2*pi,fs)';

% // function to compute y for given x and parameter b

f = @(x, b) m^3*cos(sqrt(a*r*x)).^(0.77)/r +
m^3*cos(sqrt(b*r*x)).^(0.77)/r-20;


% // first plot out of loop (to get plot handle)

figure;

b = 300;

y = f(x, b);

handle = plot(x, y);

xlabel('x') % // only set once

ylabel('y=f(x,b)') % // only set once

title(['b = ' num2str(b)]);

pause(0.1);


% // animate for b = 301 to 86

for b = 301:486 %// Change

set(handle, 'YData', f(x, b)) % set new y-data in plot handle

pause(0.1); %// update plot

title(['b = ' num2str(b)]); %// update title

end




    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?43527>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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