Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit d3feb68

Browse filesBrowse files
committed
symbolic friendly
1 parent 10aa1c0 commit d3feb68
Copy full SHA for d3feb68

File tree

Expand file treeCollapse file tree

1 file changed

+4
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+4
-0
lines changed

‎spatialmath/base/argcheck.py

Copy file name to clipboardExpand all lines: spatialmath/base/argcheck.py
+4Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.