# Set MATLAB\_ROOT environment variable

**URL:** <https://discourse.julialang.org/t/set-matlab-root-environment-variable/69815>\
**Category:** New to Julia\
**Tags:** question, matlab\
**Created:** [October 15, 2021, 10:39am UTC](https://discourse.julialang.org/t/set-matlab-root-environment-variable/69815 "2021-10-15T10:39:44Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![moeinkh88](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/moeinkh88/32/29607_2.png) [@moeinkh88](https://discourse.julialang.org/u/moeinkh88)\
**Post date:** [October 15, 2021, 10:39am UTC](https://discourse.julialang.org/t/set-matlab-root-environment-variable/69815/1 "2021-10-15T10:39:44Z")

</div>

Hi!  
I have tried Pkg.build(“MATLAB”) and I got the following error:

ERROR: Error building `MATLAB`:  
ERROR: LoadError: MATLAB cannot be found. Set the “MATLAB\_ROOT” environment variable to the MATLAB root directory and re-run Pkg.build(“MATLAB”).

I am using Linux (Ubuntu 20.04.3) and the matlab directory is: /usr/local/MATLAB  
I don’t know how to set “MATLAB\_ROOT” environment variable?
