Skip to content

Commit 3960446

Browse files
committed
Alternative array indexing
1 parent 61f8f79 commit 3960446

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

examples/pvtol-lqr.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,12 +92,12 @@
9292
alt = (1, 4)
9393

9494
# Decoupled dynamics
95-
Ax = (A[lat, :])[:, lat] # ! not sure why I have to do it this way
95+
Ax = A[np.ix_(lat, lat)]
9696
Bx = B[lat, 0]
9797
Cx = C[0, lat]
9898
Dx = D[0, 0]
9999

100-
Ay = (A[alt, :])[:, alt] # ! not sure why I have to do it this way
100+
Ay = A[np.ix_(alt, alt)]
101101
By = B[alt, 1]
102102
Cy = C[1, alt]
103103
Dy = D[1, 1]

0 commit comments

Comments
 (0)