Skip to content

Commit

Permalink
Update arrays.md
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisRackauckas authored Feb 22, 2024
1 parent 89dccfe commit fb814b7
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions docs/src/manual/arrays.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,3 +154,20 @@ AAt[2,3]
```

Here we indexed for the element (2,3), but we got back a symbolic indexing expression. You may want to force the element to be computed in terms of the elements of A. This can be done, using the `scalarize` function.

```@example arrays
Symbolics.scalarize(AAt[2,3])
```
```@example arrays
@syms i::Int j::Int
Symbolics.scalarize(AAt[i,j])
```

In general, any scalar expression which is derived from array expressions can be scalarized.

```@example arrays
#sum(A[:,1]) + sum(A[2,:])#latexify not working
```
```@example arrays
Symbolics.scalarize(sum(A[:,1]) + sum(A[2,:]))
```

0 comments on commit fb814b7

Please sign in to comment.