[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #60861] set command sometimes doesn't allow mi
From: |
Rik |
Subject: |
[Octave-bug-tracker] [bug #60861] set command sometimes doesn't allow mixed prop/value pairs and cell arrays |
Date: |
Thu, 1 Jul 2021 17:11:28 -0400 (EDT) |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.101 Safari/537.36 |
Update of bug #60861 (project octave):
Category: GUI => Octave Function
Priority: 5 - Normal => 3 - Low
Item Group: None => Matlab Compatibility
Status: None => Confirmed
Release: 6.1.0 => dev
Operating System: Microsoft Windows => Any
Summary: set command sometimes doesn't allow multiple items.
=> set command sometimes doesn't allow mixed prop/value pairs and cell arrays
_______________________________________________________
Follow-up Comment #1:
I believe the issue is that Octave expects either 1) property/value pairs, 2)
cell array of properties, cell array of values, or 3) a struct array. Try
`help set`
There are three ways to give the property names and values:
* as a comma separated list of PROPERTY, VALUE pairs
Here, each PROPERTY is a string containing the property name,
each VALUE is a value of the appropriate type for the
property.
* as a cell array of strings PROPERTIES containing property
names and a cell array VALUES containing property values.
In this case, the number of columns of VALUES must match the
number of elements in PROPERTIES. The first column of VALUES
contains values for the first entry in PROPERTIES, etc. The
number of rows of VALUES must be 1 or match the number of
elements of H. In the first case, each handle in H will be
assigned the same values. In the latter case, the first
handle in H will be assigned the values from the first row of
VALUES and so on.
* as a structure array PV
Here, the field names of PV represent the property names, and
the field values give the property values. In contrast to the
previous case, all elements of PV will be set in all handles
in H independent of the dimensions of PV.
The calling syntax you are using, and which Matlab apparently accepts, is a
mix of prop/value pairs and cell arrays. As you determined, a workaround is
to simply separate the individual calls.
You can also join calls if you want into cell arrays.
set (a, {'units', 'position', 'string'}, [repmat({'normalized'}, 3,1),
locations, txt])
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?60861>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
- [Octave-bug-tracker] [bug #60861] set command sometimes doesn't allow mixed prop/value pairs and cell arrays,
Rik <=