# What did I do wrong when installing my MATLAB.jl package?

**URL:** <https://discourse.julialang.org/t/what-did-i-do-wrong-when-installing-my-matlab-jl-package/73546>\
**Category:** General Usage\
**Tags:** question\
**Created:** [December 23, 2021, 7:53pm UTC](https://discourse.julialang.org/t/what-did-i-do-wrong-when-installing-my-matlab-jl-package/73546 "2021-12-23T19:53:46Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![leon](https://avatars.discourse-cdn.com/v4/letter/l/dc4da7/32.png) [@leon](https://discourse.julialang.org/u/leon)\
**Post date:** [December 23, 2021, 7:53pm UTC](https://discourse.julialang.org/t/what-did-i-do-wrong-when-installing-my-matlab-jl-package/73546/1 "2021-12-23T19:53:46Z")

</div>

Unfortunately, `MATLAB.jl` has not been working for me.

Not sure if it is because I first installed MATLAB.jl by `Pkg.add("MATLAB")`, then realized I did not set the environment variable as above first. So I set the environment variable and installed `MATLAB.jl` package again.

Below are the official instructions from the Github webpage. What does it mean by “making sure matlab is in executable path”? I did add the below to `~/my.zshr` file.  
`export PATH="/home/leon/MATLAB/R2021b/bin/:$PATH"`

BTW, I’m able to launch Matlab by typing “matlab” in any directory within my terminal.

**Linux**

1. Make sure `matlab` is in executable path.
2. Make sure `csh` is installed. (Note: MATLAB for Linux relies on `csh` to open an engine session.)To install `csh` in Debian/Ubuntu/Linux Mint, you may type in the following command in terminal:

sudo apt-get install csh

1. From Julia run: `Pkg.add("MATLAB")`

---

<div class="post-metadata">

**Author:** ![jling](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jling/32/212909_2.png) [@jling](https://discourse.julialang.org/u/jling)\
**Post date:** [December 23, 2021, 8:03pm UTC](https://discourse.julialang.org/t/what-did-i-do-wrong-when-installing-my-matlab-jl-package/73546/2 "2021-12-23T20:03:27Z")

</div>

> [@leon](#):
>
> installed `MATLAB.jl` package again.

try

```julia
]build MATLAB

```

also, what does

> [@leon](#):
>
> has not been working for me.

mean exactly?

---

<div class="post-metadata">

**Author:** ![FinnHB](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/finnhb/32/36096_2.png) [@FinnHB](https://discourse.julialang.org/u/FinnHB)\
**Post date:** [May 9, 2022, 8:04pm UTC](https://discourse.julialang.org/t/what-did-i-do-wrong-when-installing-my-matlab-jl-package/73546/4 "2022-05-09T20:04:01Z")

</div>

Have been facing similar issues on a windows computer.

When I try to run any functions from MATLAB.jl, julia immediately exits and the MATLAB command window opens. No warnings or errors are thrown when julia exits. Some functions work, such as `mxarray`, however, neither `mxcall`, `md""`, or `MSession` seem to work.

---

<div class="post-metadata">

**Author:** ![jling](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jling/32/212909_2.png) [@jling](https://discourse.julialang.org/u/jling)\
**Post date:** [May 9, 2022, 11:12pm UTC](https://discourse.julialang.org/t/what-did-i-do-wrong-when-installing-my-matlab-jl-package/73546/5 "2022-05-09T23:12:13Z")

</div>

what does `]build MATLAB` and `]test MATLAB` say?

---

<div class="post-metadata">

**Author:** ![FinnHB](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/finnhb/32/36096_2.png) [@FinnHB](https://discourse.julialang.org/u/FinnHB)\
**Post date:** [May 10, 2022, 8:10am UTC](https://discourse.julialang.org/t/what-did-i-do-wrong-when-installing-my-matlab-jl-package/73546/6 "2022-05-10T08:10:06Z")

</div>

![MATLAB_Error2](https://global.discourse-cdn.com/julialang/original/3X/c/3/c3928e07a7b9a8fcbc10b38473b0c22beeaaec90.png)

Don’t see anything strange with the build process, but returns exit code 3765269347 from the test.

Edit: Read that exit code 3765269347 may refer to an internal windows error. Opened julia through the commandline as an admistrator, rebuilt and ran the tests. I am now getting an error with the build process, but it passes all the tests. After doing this I now seem to be able to run the MATLAB code without julia exiting.
