[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #64318] inputParser fails on parse in mixed ad
From: |
A.R. Burgers |
Subject: |
[Octave-bug-tracker] [bug #64318] inputParser fails on parse in mixed addOptional/addParameter setting |
Date: |
Mon, 19 Jun 2023 04:35:55 -0400 (EDT) |
URL:
<https://savannah.gnu.org/bugs/?64318>
Summary: inputParser fails on parse in mixed
addOptional/addParameter setting
Group: GNU Octave
Submitter: arb
Submitted: Mon 19 Jun 2023 08:35:53 AM UTC
Category: Octave Function
Severity: 3 - Normal
Priority: 5 - Normal
Item Group: Regression
Status: None
Assigned to: None
Originator Name:
Originator Email:
Open/Closed: Open
Release: dev
Discussion Lock: Any
Operating System: Any
Fixed Release: None
Planned Release: None
_______________________________________________________
Follow-up Comments:
-------------------------------------------------------
Date: Mon 19 Jun 2023 08:35:53 AM UTC By: A.R. Burgers <arb>
The following inputParser example produces an error with dev:
p = inputParser;
p.addOptional('p_opt', []);
p.addParameter('p1', 'p1_default');
p.addParameter('p2', 'p2_default');
% 1st use: supply value for Optional argument
p_opt_val = rand(1,3);
p.parse(p_opt_val);
p_opt_val = p.Results.p_opt
p2_val = p.Results.p2
% 2nd use: no value supplied for Optional argument
p.parse()
p_opt_val = p.Results.p_opt
p2_val = p.Results.p2
octave-8.x (and matlab) output:
p_opt_val = 0.6983 0.9372 0.6371
p2_val = p2_default
p_opt_val = [](0x0)
p2_val = p2_default
octave-9.x error message, when optional argument not specified:
p_opt_val = 0.4458 0.8761 0.1959
p2_val = p2_default
error: horizontal dimensions mismatch (1x1 vs 2x1)
error: called from
add_missing at line 678 column 28
parse at line 527 column 7
tst at line 11 column 1
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?64318>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
- [Octave-bug-tracker] [bug #64318] inputParser fails on parse in mixed addOptional/addParameter setting,
A.R. Burgers <=