# Problems with Diagonal from LinearAlgebra

**URL:** <https://discourse.julialang.org/t/problems-with-diagonal-from-linearalgebra/26429>\
**Category:** General Usage\
**Tags:** question, package, linearalgebra\
**Created:** [July 16, 2019, 3:28pm UTC](https://discourse.julialang.org/t/problems-with-diagonal-from-linearalgebra/26429 "2019-07-16T15:28:02Z")\
**Posts on this page:** 1\
**Showing post:** 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:** [July 16, 2019, 4:01pm UTC](https://discourse.julialang.org/t/problems-with-diagonal-from-linearalgebra/26429/6 "2019-07-16T16:01:32Z")

</div>

> [@cholt](#):
>
> Agreed, but if all I’m doing is overwriting some variables, why does that change things

By changing the inputs, the functions give different results.

> [@cholt](#):
>
> And how can I prevent that from happening?

It is hard to answer this without concrete code.

> [@cholt](#):
>
> Furthermore it is defined within a function

It would be much easier to help you if you provided the a self-contained example that demonstrates the problem in a freshly started Julia session.

> [@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/problems-with-diagonal-from-linearalgebra/26429)._
