bugGNU Octave - Bugs: bug #43527, Bug / compatibility to plotting...

 
 

bug #43527: Bug / compatibility to plotting any way to work around

Submitted by:  Rick T <ratulloch>
Submitted on:  Tue 04 Nov 2014 02:35:29 PM UTC  
 
Category: PlottingSeverity: 3 - Normal
Priority: 5 - NormalItem Group: None
Status: Wont FixAssigned to: Carlo de Falco <cdf>
Originator Name: Rick TOpen/Closed: Closed
Release: 3.8.1Operating System: GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Wed 05 Nov 2014 08:01:31 PM UTC, comment #3:

yes i'm happy with the work around of set(handle, 'YData', real (f(x, b)))

please note the plot is not the same if you use set(handle, 'YData', abs (f(x, b)))

I tested this with matlab 8.2.0.701 (R2013b) win7 and octave 3.8.1 running Ubuntu 64bit

Rick T <ratulloch>
Wed 05 Nov 2014 10:08:53 AM UTC, comment #2:

From the discussion on the mailing list,
it seems the original poster is happy with
the proposed workaround.

I'm closing the bug report as I don't
think it makes sense to copy this "feature",
if anyone thinks differently feel free
to re-open the issue.

Carlo de Falco <cdf>
Project MemberIn charge of this item.
Tue 04 Nov 2014 03:33:21 PM UTC, comment #1:

This question was already posted to the mailing list :
http://lists.gnu.org/archive/html/help-octave/2014-11/msg00023.html

and was replied there:
http://lists.gnu.org/archive/html/help-octave/2014-11/msg00024.html

I don't believe it may be considered a bug that
Octave refuses to use complex data as the 'ydata' in
a 2D plot.

It may be considered a compatibility issue if Matlab silently
accepts complex data and plots the real part / absolute value.
But even in this case it looks like a weird undocumented behaviour
in Matlab which I am not sure it makes sense to copy ...

Can you check whether in Matlab

is equivalent to

or to

c.

Carlo de Falco <cdf>
Project MemberIn charge of this item.
Tue 04 Nov 2014 02:35:29 PM UTC, original submission:

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^3cos(sqrt(arx)).^(0.77)/r + m^3cos(sqrt(brx)).^(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

Rick T <ratulloch>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by cdf (Posted a comment)
  • -unavailable- added by ratulloch (Submitted the item)
  • -unavailable- added by ratulloch
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 05 Nov 2014 10:08:53 AM UTCcdfStatusNeed Info=>Wont Fix
      Open/ClosedOpen=>Closed
    Tue 04 Nov 2014 03:33:21 PM UTCcdfStatusNone=>Need Info
      Assigned toNone=>cdf
    Tue 04 Nov 2014 02:35:29 PM UTCratullochCarbon-Copy-=>Added -unavailable-

    Back to the top


    Powered by Savane 3.1-cleanup1