# Unexpected comma in array expression Stacktrace:

**URL:** https://discourse.julialang.org/t/unexpected-comma-in-array-expression-stacktrace/92993
**Category:** Performance
**Created:** [January 15, 2023, 1:52pm UTC](https://discourse.julialang.org/t/unexpected-comma-in-array-expression-stacktrace/92993 "2023-01-15T13:52:31Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![priyanshujiiii](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/priyanshujiiii/32/45853_2.png) [@priyanshujiiii](https://discourse.julialang.org/u/priyanshujiiii)
#### Post date: [January 15, 2023, 1:52pm UTC](https://discourse.julialang.org/t/unexpected-comma-in-array-expression-stacktrace/92993/1 "2023-01-15T13:52:31Z")

</div>

![Screenshot (18)](https://global.discourse-cdn.com/julialang/original/3X/4/9/49e92d2abfc32fb06fad2de89665e82c2e07b0e8.png)

---

<div class="post-metadata">

### Author: ![uniment](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/uniment/32/24532_2.png) [@uniment](https://discourse.julialang.org/u/uniment)
#### Post date: [January 15, 2023, 2:02pm UTC](https://discourse.julialang.org/t/unexpected-comma-in-array-expression-stacktrace/92993/2 "2023-01-15T14:02:47Z")

</div>

In the portion of the code `[1 -exp(...`, if you have a space to the left of `-` but not to the right of it, then it is parsed as a unary operator and the structure is parsed as a matrix instead of just a vector. Commas are not allowed in matrix expressions.

To achieve the desired result, either:

1. Delete the space, `[1-exp(...`, or
2. Ensure there are spaces on both sides, `[1 - exp(...`.

It is good practice to make the whitespace around operators symmetric for readability anyway.
