gnu-octave / symbolic

A Symbolic Package for Octave using SymPy
https://octave.sourceforge.io/symbolic/
GNU General Public License v3.0
151 stars 36 forks source link

Array_not_Matrix: can reference 1x1 Array #1232

Open cbm755 opened 1 year ago

cbm755 commented 1 year ago

Consider

>> syms x
>> e = [x==3 x>=2]
ans = (sym) [[x = 3  x ≥ 2]]  (1×2 matrix)

So far so good, but index one of those out:

>> e(2)
ans = (sym) [[x ≥ 2]]

The result is a 1x1 Array. Compare to:

>> x >= 2
ans = (sym) x ≥ 2

We try to avoid making 1x1 Matrices in Symbolic (even though SymPy happily will) b/c of Octave double behaviour. Probably need to do something similar for Array...