How to set the environment variable MATLAB_ROOT when installing MATLAB.jl?

My goal is to install MATLAB.jl package. The instructions say the below"

“By default, MATLAB.jl uses the MATLAB installation with the greatest version number. To specify that a specific MATLAB installation should be used, set the environment variable MATLAB_ROOT .”

Here is my question. How do I set the environmental variable “MATLAB_ROOT”?

My Matlab was installed at /home/name/MATLB/R2021b/bin/

an environment variable is not something you usually set within Julia, but technically you can do:

julia> ENV["MATLAB_ROOT"] = "/home/name/MATLB/R2021b/bin/"
1 Like

Many thanks for the help!