# @.  and UndefVarError

**URL:** https://discourse.julialang.org/t/and-undefvarerror/19399
**Category:** New to Julia
**Created:** [January 8, 2019, 9:59pm UTC](https://discourse.julialang.org/t/and-undefvarerror/19399 "2019-01-08T21:59:41Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![rdeits](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rdeits/32/286_2.png) [@rdeits](https://discourse.julialang.org/u/rdeits)
#### Post date: [January 8, 2019, 10:09pm UTC](https://discourse.julialang.org/t/and-undefvarerror/19399/2 "2019-01-08T22:09:38Z")

</div>

You don’t need to apply `@.` to the _entire_ function (and I wouldn’t recommend doing so, for exactly the reason you’ve run into here). The problem is that `@.` turns your `=` into `.=`, which in turn transforms `w = ...` into `w .= ...` which tries to broadcast the result into the (non-existent) array `w`.

Instead, just do:

```julia
function dummy(x, p)
  w = @.(3.0*x[:,2] +p[1] +x[:,1]*p[2])
  return w
end

```

Also, please [quote your code](https://discourse.julialang.org/t/psa-how-to-quote-code-with-backticks/7530) so that it will render correctly.

---

_[View the full topic](https://discourse.julialang.org/t/and-undefvarerror/19399)._
