patchGNU Octave - Patches: patch #10350, new function: isminphase.m

 
 

patch #10350: new function: isminphase.m

Submitter:  Leonardo <leolca>
Submitted:  Mon 15 May 2023 05:35:52 PM UTC
   
 
Category:  Core : new function Priority:  5 - Normal
Status:  Done Privacy:  Public
Assigned to:  lostbard Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Wed 28 Jun 2023 01:07:33 PM UTC, comment #3: 

Thanks for the updates - I pushed to the repo after some space/tab reformating

John Donoghue <lostbard>
Group Member
Wed 28 Jun 2023 12:46:22 PM UTC, comment #2: 

Here are the corrections:

1) I've corrected the first line checking the input arguments:

 function flag = isminphase (b, a, tol)
-    if (nargin < 1 || nargin > 3 || (nargin == 2 && isrow (b)))
+    if (nargin < 1 || nargin > 3 || (nargin == 2 && ! isrow (b)) || (length (a) > 1 && ! isrow (a)) || (length (b) > 1 && ! isrow (b)) || (nargin == 3 && ! isscalar (tol)) )
        print_usage;
     endif

2) I've removed one test case that should not give an error:

 %!error n = isminphase ()
-%!error n = isminphase (1, 1, 1)
 %!error n = isminphase (1, 1, 1, 1)

The diff file and the corrected file follow attached.

(file #54889, file #54890)

Leonardo <leolca>
Tue 27 Jun 2023 06:47:00 PM UTC, comment #1: 

I see fails occuring with the run of the test data:

octave:4> a = [1 0.5]; b = [3 1];
octave:5> isminphase (b, a)
error: Invalid call to isminphase.  Correct usage is:

 -- Function File: L = isminphase (B, A)
 -- Function File: L = isminphase (SOS)
 -- Function File: L = isminphase (..., TOL)





octave:3> [b, a] = butter (1, .5);
octave:4> a
a =

   1.0000e+00  -5.5511e-17

octave:5> b
b =

   0.5000   0.5000

octave:6> f = isminphase (b, a)
error: Invalid call to isminphase.  Correct usage is:

 -- Function File: L = isminphase (B, A)
 -- Function File: L = isminphase (SOS)
 -- Function File: L = isminphase (..., TOL)

John Donoghue <lostbard>
Group Member
Mon 15 May 2023 05:35:52 PM UTC, original submission:  

implementation of the function isminphase.m

Leonardo <leolca>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #54889:  isminphase.m added by leolca (3KiB - text/x-objcsrc)
file #54890:  diff_isminphase.m added by leolca (692B - text/x-objcsrc)
file #54752:  isminphase.patch added by leolca (3KiB - text/x-patch)
file #54753:  isminphase.m added by leolca (3KiB - text/x-objcsrc)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by lostbard (Posted a comment)
  • -email is unavailable- added by leolca (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 8 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2023-06-28 lostbard StatusNeed Info Done
        Assigned toNone lostbard
        Open/ClosedOpen Closed
    2023-06-28 leolca Attached File- Added isminphase.m, #54889
        Attached File- Added diff_isminphase.m, #54890
    2023-06-27 lostbard StatusNone Need Info
    2023-05-15 leolca Attached File- Added isminphase.patch, #54752
        Attached File- Added isminphase.m, #54753

    Back to the top

    Powered by Savane 3.13-4b48.
    Corresponding source code