From 7d25523b2f9a4475cdc85972f6caef1ccc8416d8 Mon Sep 17 00:00:00 2001
From: Etienne Gavazzi <98973824+egavazzi@users.noreply.github.com>
Date: Fri, 22 Sep 2023 17:58:47 +0200
Subject: [PATCH 1/4] Update README.md warning about segfault issue
---
README.md | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/README.md b/README.md
index 917b95a..bba5f53 100644
--- a/README.md
+++ b/README.md
@@ -1,8 +1,7 @@
## MATLAB
-
-| :exclamation: ** MATLAB versions 2022 and 2023 trigger a segfault and do not work with `MATLAB.jl`. Maintainers are attempting to diagnose the cause and fix the issue. ** |
-|-----------------------------------------|
+| :white_check_mark: ** MATLAB versions 2022 and 2023 now work with `MATLAB.jl`.** |
+|----------------------------------------------------------------------------------|
From ed6b38ba852cc36991b4d3678a624411d210c2a6 Mon Sep 17 00:00:00 2001
From: Etienne Gavazzi <98973824+egavazzi@users.noreply.github.com>
Date: Wed, 11 Oct 2023 09:54:45 +0200
Subject: [PATCH 2/4] Update README.md
Add info about updating the MATLAB release in case of segfault
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index bba5f53..a72c071 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
## MATLAB
-| :white_check_mark: ** MATLAB versions 2022 and 2023 now work with `MATLAB.jl`.** |
+| :white_check_mark: ** MATLAB versions 2022 and 2023 now work with `MATLAB.jl` **
If you experience a segfault when starting the MATLAB engine, try to [update](https://se.mathworks.com/help/matlab/matlab_env/check-for-software-updates.html) your MATLAB release |
|----------------------------------------------------------------------------------|
From fe9e7e775ee91d1f70a7ba169cb564b309641bff Mon Sep 17 00:00:00 2001
From: Etienne Gavazzi <98973824+egavazzi@users.noreply.github.com>
Date: Tue, 17 Oct 2023 14:39:23 +0200
Subject: [PATCH 3/4] add specific platform warnings regarding issues with
R2022/2023
---
README.md | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index a72c071..b5d1977 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,10 @@
## MATLAB
-| :white_check_mark: ** MATLAB versions 2022 and 2023 now work with `MATLAB.jl` **
If you experience a segfault when starting the MATLAB engine, try to [update](https://se.mathworks.com/help/matlab/matlab_env/check-for-software-updates.html) your MATLAB release |
-|----------------------------------------------------------------------------------|
+| ❗ Windows and MacOS platforms : MATLAB versions R2022 and R2023 do not work with `MATLAB.jl`. ❗ |
+|:----:|
+
+| ❗ Linux platforms : If you experience problems when starting the MATLAB engine with versions R2022 or R2023, try to [update](https://se.mathworks.com/help/matlab/matlab_env/check-for-software-updates.html) your MATLAB release. |
+|:----:|
From 5b119961b343f759efd621a4d5b9dfe88e0326dd Mon Sep 17 00:00:00 2001
From: Etienne Gavazzi <98973824+egavazzi@users.noreply.github.com>
Date: Tue, 17 Oct 2023 14:44:41 +0200
Subject: [PATCH 4/4] clarify instructions on how to use different Matlab
versions
---
README.md | 22 +++++++++++++++++++---
1 file changed, 19 insertions(+), 3 deletions(-)
diff --git a/README.md b/README.md
index b5d1977..634cd0b 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
## MATLAB
-| ❗ Windows and MacOS platforms : MATLAB versions R2022 and R2023 do not work with `MATLAB.jl`. ❗ |
+| ❗ Windows and MacOS platforms : MATLAB versions R2022 and R2023 do not work with `MATLAB.jl` ❗
You can use older versions as explained [further down](https://github.com/JuliaInterop/MATLAB.jl#changing_matlab_version). |
|:----:|
| ❗ Linux platforms : If you experience problems when starting the MATLAB engine with versions R2022 or R2023, try to [update](https://se.mathworks.com/help/matlab/matlab_env/check-for-software-updates.html) your MATLAB release. |
@@ -31,8 +31,6 @@ This package is composed of two aspects:
**Important**: The procedure to setup this package consists of the following steps.
-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`.
-
### Windows
1. For Matlab R2020a onwards, you should be able to go directly to step 2. If you encounter issues, run `matlab -batch "comserver('register')"` in the command prompt. For earlier versions of Matlab, start a command prompt as an administrator and enter `matlab /regserver`.
@@ -62,6 +60,24 @@ By default, `MATLAB.jl` uses the MATLAB installation with the greatest version n
2. From Julia run: `Pkg.add("MATLAB")`
+## Changing MATLAB version
+
+By default, `MATLAB.jl` is built using the MATLAB installation with the greatest version number. To specify that a specific MATLAB installation should be used, set the environment variable `MATLAB_ROOT`:
+```julia
+julia> ENV["MATLAB_ROOT"] = "/usr/local/MATLAB/R2021b" # example on a Linux machine
+```
+```julia
+julia> ENV["MATLAB_ROOT"] = raw"C:\Program Files\MATLAB\R2021b" # example on a Windows machine
+```
+Replace the path string with the location of the MATLAB folder on your machine. You need to set the path to the `R20XX` folder, not the `matlab` binary.
+
+If you had the package `MATLAB.jl` already installed and built before changing the environment variable, you will need to rebuild it to apply the change:
+```julia
+julia> using Pkg; Pkg.build("MATLAB")
+```
+
+
+
## Usage
### MxArray class