[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #39041] concatenation of cell array and scalar
From: |
Clemens Buchacher |
Subject: |
[Octave-bug-tracker] [bug #39041] concatenation of cell array and scalar struct |
Date: |
Wed, 22 May 2013 16:07:01 +0000 |
User-agent: |
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:20.0) Gecko/20100101 Firefox/20.0 |
URL:
<http://savannah.gnu.org/bugs/?39041>
Summary: concatenation of cell array and scalar struct
Project: GNU Octave
Submitted by: drizzd
Submitted on: Wed 22 May 2013 04:07:01 PM GMT
Category: Interpreter
Severity: 3 - Normal
Priority: 5 - Normal
Item Group: Matlab Compatibility
Status: None
Assigned to: None
Originator Name: Clemens Buchacher
Originator Email:
Open/Closed: Open
Discussion Lock: Any
Release: 3.6.4
Operating System: Microsoft Windows
_______________________________________________________
Details:
This is legal in Matlab R2011b
>> [{}, struct()]
ans =
[1x1 struct]
but not in Octave:
octave:1> [{}, struct()]
error: octave_base_value::cell_value(): wrong type argument 'scalar struct'
Octave is consistent for other scalar or array types:
octave:2> [{}, 1]
ans =
{
[1,1] = 1
}
octave:3> [{}, [1, 2]]
ans =
{
[1,1] =
1 2
}
A workaround is to enclose the scalar struct in parentheses:
octave:1> [{}, {struct()}]
ans =
{
[1,1] =
scalar structure containing the fields:
}
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?39041>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Octave-bug-tracker] [bug #39041] concatenation of cell array and scalar struct,
Clemens Buchacher <=