[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #62431] 'format' function inputs and outputs a
From: |
Nicholas Jankowski |
Subject: |
[Octave-bug-tracker] [bug #62431] 'format' function inputs and outputs a display state object |
Date: |
Mon, 9 May 2022 13:37:23 -0400 (EDT) |
URL:
<https://savannah.gnu.org/bugs/?62431>
Summary: 'format' function inputs and outputs a display
state object
Project: GNU Octave
Submitted by: nrjank
Submitted on: Mon 09 May 2022 01:37:21 PM EDT
Category: Octave Function
Severity: 1 - Wish
Priority: 5 - Normal
Item Group: Feature Request
Status: None
Assigned to: None
Originator Name: Nicholas Jankowski
Originator Email:
Open/Closed: Open
Release: dev
Discussion Lock: Any
Operating System: Any
_______________________________________________________
Details:
Another Matlab 2021a change to format, it optionally outputs one argument
which is a 'DisplayformatOptions' containing the NumericFormat and LineSpacing
properties set by format. calling format with one of these objects as input
will set the state to that stored in the object.
compatable behavior could probably be trivially implemented by outputing a
struct with the right fields, and setting them accordingly if you get an
isstruct on the input arguments. Or slightly better by creating a simple
DisplayFormatOptions class overloading format to do the same thing.
But this new output behavior would be incompatable with format's current
behavior of outputting the state in 1-3 output variables according to
nargout.
see https://www.mathworks.com/help/matlab/ref/format.html
some testing also shows that it permits simultaneous inputs and outputs,
storing the previous setting in the output variable, then setting the new
state:
>> a = format
a =
DisplayFormatOptions with properties:
NumericFormat: "short"
LineSpacing: "loose"
>> a = format('longe')
a =
DisplayFormatOptions with properties:
NumericFormat: "short"
LineSpacing: "loose"
>> a = format
a =
DisplayFormatOptions with properties:
NumericFormat: "longE"
LineSpacing: "loose"
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?62431>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
- [Octave-bug-tracker] [bug #62431] 'format' function inputs and outputs a display state object,
Nicholas Jankowski <=