Skip to content

Commit d3feb68

Browse files
committed
symbolic friendly
1 parent 10aa1c0 commit d3feb68

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

‎spatialmath/base/argcheck.py‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,11 +171,15 @@ def getmatrix(m, shape, dtype=np.float64):
171171
- If ``m`` is a scalar, return an array of shape (1,1)
172172
173173
:seealso: :func:`ismatrix`, :func:`verifymatrix`
174+
:SymPy: supported
174175
"""
175176
if isinstance(m, np.ndarray) and len(m.shape) == 2:
176177
# passed a 2D array
177178
mshape = m.shape
178179

180+
if m.dtype == 'O':
181+
dtype = 'O'
182+
179183
if (shape[0] is None or shape[0] == mshape[0]) and (shape[1] is None or shape[1] == mshape[1]):
180184
return np.array(m, dtype=dtype)
181185
else:

0 commit comments

Comments
 (0)