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

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

[Octave-bug-tracker] [bug #33808] nargchk should return empty matrix if


From: Volkmar Glauche
Subject: [Octave-bug-tracker] [bug #33808] nargchk should return empty matrix if inputs are within range
Date: Wed, 20 Jul 2011 10:27:29 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:5.0) Gecko/20100101 Firefox/5.0

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

                 Summary: nargchk should return empty matrix if inputs are
within range
                 Project: GNU Octave
            Submitted by: glauche
            Submitted on: Mi 20 Jul 2011 10:27:27 GMT
                Category: None
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Matlab Compatibility
                  Status: None
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: dev
        Operating System: GNU/Linux

    _______________________________________________________

Details:

nargchk behaviour differs between MATLAB and octave in cases like the
following:

s = nargchk(1,5,4,'struct')

MATLAB returns

s =

0x1 struct array with fields:
    message
    identifier

Octave returns

s =

  scalar structure containing the fields:


octave:5> whos s
Variables in the current scope:

   Attr Name        Size                     Bytes  Class
   ==== ====        ====                     =====  ===== 
        s           1x1                          0  struct

I.e. MATLAB returns an empty struct with two fields, while Octave returns a
1-element struct with no fields. MATLAB has documented its nargchk behaviour
as follows:

--- cited from MATLAB help
MSGSTRUCT = NARGCHK(LOW,HIGH,N,'struct') returns an appropriate message
structure if N is not between LOW and HIGH. If N is in the specified range,
the message structure is empty. The message structure has at a minimum two
fields, 'message' and 'identifier'.
---

MATLAB code that relies on this behaviour will fail on Octave if N is in the
specified range. This may be related to bug #33428.




    _______________________________________________________

Reply to this item at:

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

_______________________________________________
  Nachricht geschickt von/durch Savannah
  http://savannah.gnu.org/




reply via email to

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