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

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

[Octave-bug-tracker] [bug #49143] inputdlg does not handle well vectors


From: Nicholas Jankowski
Subject: [Octave-bug-tracker] [bug #49143] inputdlg does not handle well vectors
Date: Wed, 14 Sep 2022 12:19:29 -0400 (EDT)

Follow-up Comment #10, bug #49143 (project octave):

I'm surprised (but i guess not overly surprised) that the matlab code worked. 
the [1 70] size input should through an error if it strictly followed their
published documentation at:
https://www.mathworks.com/help/matlab/ref/inputdlg.html#d123e751295

note that this has changed a bit over the years, an older version of the
matlab function inputs described at:
http://www.ece.northwestern.edu/local-apps/matlabhelp/techdoc/ref/inputdlg.html

but matlab is known to have unexpected undocumented behavior, which I believe
this is.  the [1 70] input doesn't match any of the documented forms for that
input, which Octave enforces. 

if that input is a scalar, it applies that as height of all input fields in
prompt.  if it's a 2d array, it has to have the same number of rows as
elements in prompt and two elements in width, one specifying the height and
the other the width of the respective dialog.  if it's a vector, as yours is,
the old version said it had to be a column vector (the new version allows a
row vector) where each element is the height of the respective dialog. implied
is that it has to have the same number of elements as prompt, otherwise there
is no definition for expected behavior. 

matlab apparently has decided to implicitly expand row vectors to be
interpreted in the array case, with the same definition [rows cols] applied to
all inputs. playing around with different combinations, it seems arbitrary,
and I'm not certain it's all intentional.  if you only have two prompts, [1
70] and [1;70] give you very different results despite what the help text
says.



    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?49143>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/




reply via email to

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