# Strange broadcasting results

**URL:** <https://discourse.julialang.org/t/strange-broadcasting-results/36387>\
**Category:** General Usage\
**Tags:** question\
**Created:** [March 23, 2020, 11:25am UTC](https://discourse.julialang.org/t/strange-broadcasting-results/36387 "2020-03-23T11:25:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eben60](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/eben60/32/13475_2.png) [@Eben60](https://discourse.julialang.org/u/Eben60)\
**Post date:** [March 23, 2020, 11:25am UTC](https://discourse.julialang.org/t/strange-broadcasting-results/36387/1 "2020-03-23T11:25:28Z")

</div>

```julia
F = 59411.4
n = 12
K = [220.0, 900.0]

@show S_1 = F/(n*K[1])
@show S_2 = F/(n*K[2])
@show S_dot = F./(K.*n)
@show S_nodot = F/(n*K)
@. S_atdot = F/(K*n)
# S_alldots .= F./(K.*n) # UndefVarError: S_alldots not defined

```

produces:

```julia
S_1 = F / (n * K[1]) = 22.50431818181818
S_2 = F / (n * K[2]) = 5.501055555555555
S_dot = F ./ (K .* n) = [22.50431818181818, 5.501055555555555]
S_nodot = F / (n * K) = [1.2688828052190122 5.190884203168686]
ERROR: LoadError: UndefVarError: S_atdot not defined
Stacktrace:
 [1] top-level scope at /Volumes/home/AD2000/Smin_not_defined.jl:10
in expression starting at /Volumes/home/AD2000/Smin_not_defined.jl:10

```

What is being calculated in S\_nodot?  
Why `@.` produces error here, and what does it mean “`S_atdot` not defined” as `S_atdot` stands on the left side of the expression?

Julia 1.3.0 on Win10 and 1.3.1 on Mac 10.14.6

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [March 23, 2020, 11:55am UTC](https://discourse.julialang.org/t/strange-broadcasting-results/36387/2 "2020-03-23T11:55:20Z")

</div>

> [@Eben60](#):
>
> What is being calculated in S\_nodot?

`F * pinv(n*K)`. See `@edit F/(n*K)`.

> [@Eben60](#):
>
> Why `@.` produces error here, and what does it mean " `S_atdot` not defined" as `S_atdot` stands on the left side of the expression?

Here it means “assign to elements of `S_atdot` after calculating the result elementwise”, so it has to exist. Perhaps you meant

```julia
S_atdot = @. F/(K*n)

```

See the manual on broadcasting.
