Declaring constant

Hi All,

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

using OrdinaryDiffEq, ModelingToolkit, BenchmarkTools
using MAT

cd(dirname(@__FILE__))

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

The following error occurs


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?

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

Try restarting Julia.

1 Like