# Understanding mutating functions correctly

**URL:** <https://discourse.julialang.org/t/understanding-mutating-functions-correctly/30651>\
**Category:** New to Julia\
**Tags:** question\
**Created:** [November 3, 2019, 1:49pm UTC](https://discourse.julialang.org/t/understanding-mutating-functions-correctly/30651 "2019-11-03T13:49:01Z")\
**Posts on this page:** 1\
**Showing post:** 2

<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:** [November 3, 2019, 2:05pm UTC](https://discourse.julialang.org/t/understanding-mutating-functions-correctly/30651/2 "2019-11-03T14:05:32Z")

</div>

> [@1991sig](#):
>
> Am I doing something wrong, or is the `M.Fit.β = β` and same for the other vectors strictly necessary in these cases?

This depends on what `β` is — if it is an array, then `β = M.Fit.β` should be sufficient to make sure they are the same, except that you create new one with

```julia
β = β + Jinv * U

```

(In the future, please include a **self-contained MWE** , which should make it much easier to help you.)

> [@Please read: make it easier to help you](https://discourse.julialang.org/t/psa-make-it-easier-to-help-you/14757):
>
> Welcome to the Julia Discourse! We are enthusiastic about helping Julia programmers, both beginner and experienced. This public service announcement (PSA) outlines best practices when asking for help. Following these points makes it easier for us to help you and more likely you’ll get a prompt, useful answer. Keywords are highlighted to make it easier to refer to specific points. Choose a descriptive title that captures the key part of your question, eg “plots with multiple axes” instead of …

---

_[View the full topic](https://discourse.julialang.org/t/understanding-mutating-functions-correctly/30651)._
