bugGNU Octave - Bugs: bug #57712, [octave forge] (control) pzmap...

 
 

bug #57712: [octave forge] (control) pzmap (sys1, sys2) raises error on isempty (zer{:})

Submitted by:  None
Submitted on:  Fri 31 Jan 2020 05:14:13 PM UTC  
 
Category:  Octave Forge Package Severity:  3 - Normal
Priority:  5 - Normal Item Group:  None
Status:  Confirmed Assigned to:  None
Originator Name:  gs Originator Email:  -email is unavailable-
Open/Closed:  Open Release:  dev
Operating System:  GNU/Linux

Add a New Comment (Rich Markup)
   

You are not logged in

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

 

( Jump to the original submission)

Sat 08 Feb 2020 09:23:46 PM UTC, comment #13: 

Confirmed that your patch fixes the original issue here, but includes some debug output that was left on, and adds some trailing whitespace at the ends of some lines (maybe you can configure your editor to delete all trailing whitespace).

It also does not address bug #57716, and makes some of the examples in that bug worse.

Mike Miller <mtmiller>
Project Administrator
Thu 06 Feb 2020 09:09:50 PM UTC, comment #12: 

Here is some test code to see the legend in action.

s = tf('s');
g = (s+1)/(s+1.3)
g1 = (s+2)/1
g2 = (s+3)/(s+3.1)
g3=1/(s+4)
g4=(s+5)/((s+5.2)*(s+5.7))
g5=(s+6)

pzmap(g,g1,g2,g3,g4,g5);

Doug Stewart <dastew>
Thu 06 Feb 2020 08:57:18 PM UTC, comment #11: 

try this patch attached ;

(file #48364)

Doug Stewart <dastew>
Thu 06 Feb 2020 07:58:38 PM UTC, comment #10: 

Maybe we should delete the legend entirely. If you look at the screenshots on bug #57716 or on https://www.mathworks.com/help/control/ref/pzmap.html, Matlab's pzmap does not add a legend.

Mike Miller <mtmiller>
Project Administrator
Thu 06 Feb 2020 01:36:24 PM UTC, comment #9: 

If we replace these 2 lines : 

 

   pol_args = horzcat (cellfun (@horzcat, pol_re, pol_im, sty_pol, "uniformoutput", false){:});
   zer_args = horzcat ( cellfun (@horzcat, zer_re, zer_im, sty_zer, "uniformoutput", false){:});

  

 With the following code:

    pol_args=horzcat ( pol_re(1), pol_im(1), sty_pol{1});
    for k=2:numel(pol)
      pol_args = [pol_args  horzcat(pol_re(k), pol_im(k), sty_pol{k})];
    endfor  

        

    zer_args=horzcat ( zer_re(1), zer_im(1), sty_zer{1});
    for k=2:numel(zer)
      zer_args = [zer_args horzcat(zer_re(k), zer_im(k), sty_zer{k})];
    endfor

  

  Then it works.  But now the legend is all wrong.
 I am working on the legend problem now.

Doug Stewart <dastew>
Wed 05 Feb 2020 06:09:09 PM UTC, comment #8: 

I think horzcat is working correctly, so we probably need some other syntax to accommodate empty entries the way you want.

Mike Miller <mtmiller>
Project Administrator
Wed 05 Feb 2020 04:28:23 PM UTC, comment #7: 

I am working on this bug.
Bugs 57716 57712 and 53780 are all the same problem showing up differently.

the problem is on these lines:

    pol_args = horzcat (cellfun (@horzcat, pol_re, pol_im, sty_pol, "uniformoutput", false){:});
    zer_args = horzcat (cellfun (@horzcat, zer_re, zer_im, sty_zer, "uniformoutput", false){:} );

the problem is that horzcat ignores blank values instead it should insert a [] in the resulting cell  structure.
.

Doug Stewart <dastew>
Sat 01 Feb 2020 12:34:51 AM UTC, comment #6: 

Yes you are correct Mike. It is my fault.

I need help deciding the proper way to handle this.

I guess we need a loop over each system and somehow store the results and then plot each system with a different colour scheme.
 any better suggestions?

Doug Stewart <dastew>
Fri 31 Jan 2020 07:07:18 PM UTC, comment #5: 

You're right, it's any two or more systems.

This error is caused by the bug fix for bug #53780, which didn't take into account more than one system.

Cc Doug.

Mike Miller <mtmiller>
Project Administrator
Fri 31 Jan 2020 06:58:59 PM UTC, comment #4: 

not just when there are no zeros:

>> pzmap(tf([1 9],[1 2 2 4 5]),tf([1 2],[1 2 3]))

error: Invalid call to isempty.  Correct usage is:

 -- isempty (A)
error: called from
    print_usage at line 91 column 5
    pzmap at line 117 column 5

Anonymous
Fri 31 Jan 2020 06:31:39 PM UTC, comment #3: 

Confirmed with later versions of Octave. The error occurs when the systems have no zeros, and an empty cell array is expanded as the arguments to isempty.

Mike Miller <mtmiller>
Project Administrator
Fri 31 Jan 2020 05:28:00 PM UTC, comment #2: 

my comments about the bad options for this function:

https://octave.1599824.n4.nabble.com/pzmap-bad-options-control-td4695528.html

Anonymous
Fri 31 Jan 2020 05:22:52 PM UTC, comment #1: 

with style

>> pzmap(tf([1],[1 2]),'b',tf([2],[2 3]),'r')

error: Invalid call to isempty.  Correct usage is:

 -- isempty (A)
error: called from
    print_usage at line 91 column 5
    pzmap at line 117 column 5

Anonymous
Fri 31 Jan 2020 05:14:13 PM UTC, original submission:  

>> pkg load control
>> pzmap(tf(1,[1 2]),tf(2,[2 3]))

error: Invalid call to isempty.  Correct usage is:

 -- isempty (A)
error: called from
    print_usage at line 91 column 5
    pzmap at line 117 column 5

Anonymous

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #48364:  1614.patch added by dastew (3KiB - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by dastew (Posted a comment)
  • -email is unavailable- added by mtmiller
  •  

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

    Only project members can vote.

     

     

     

    Follow 8 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-02-06 dastew Attached File- => Added 1614.patch, #48364
    2020-01-31 mtmiller Carbon-CopyRemoved dougstew => -
    2020-01-31 mtmiller Carbon-Copy- => Added dastew
    2020-01-31 mtmiller Carbon-Copy- => Added dougstew
    2020-01-31 mtmiller CategoryNone => Octave Forge Package
        StatusNone => Confirmed
        Release4.2.2 => dev
        Summarypzmap(sys1,sys2) doesn't work, (control) => [octave forge] (control) pzmap (sys1, sys2) raises error on isempty (zer{:})

    Back to the top


    Powered by Savane 3.5