# Declaring constant

**URL:** https://discourse.julialang.org/t/declaring-constant/62374
**Category:** New to Julia
**Tags:** question
**Created:** [June 4, 2021, 5:28am UTC](https://discourse.julialang.org/t/declaring-constant/62374 "2021-06-04T05:28:02Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Deepa](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/deepa/32/23385_2.png) [@Deepa](https://discourse.julialang.org/u/Deepa)
#### Post date: [June 4, 2021, 5:28am UTC](https://discourse.julialang.org/t/declaring-constant/62374/1 "2021-06-04T05:28:02Z")

</div>

Hi All,

In the following, I am trying to define `factor` as a constant.

```julia
using OrdinaryDiffEq, ModelingToolkit, BenchmarkTools
using MAT

cd(dirname(@ __FILE__ ))

factor_f = matread("factor.mat");
const factor = vec(factor_f["variable"])

```

The following error occurs

```julia

in expression starting at /home/xxxx/file.jl:7
ERROR: LoadError: cannot declare `factor` constant; it already has a value
Stacktrace:

```

Could someone suggest how to fix this?

---

<div class="post-metadata">

### Author: ![DNF](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dnf/32/10191_2.png) [@DNF](https://discourse.julialang.org/u/DNF)
#### Post date: [June 4, 2021, 5:34am UTC](https://discourse.julialang.org/t/declaring-constant/62374/2 "2021-06-04T05:34:38Z")

</div>

The error message says that `factor` already exists. That’s the explanation.

Try restarting Julia.
