In this short tutorial we want to use common Matlab commands within the BoSSS framework.

1 Problem statement

For our matrix analysis we use the following random matrix: $$ A = \begin{bmatrix} 1 & 2 & 3\\ 4 & 5 & 6\\ 7 & 8 & 9 \end{bmatrix} $$ and the symmetric matrix: $$ S = \begin{bmatrix} 1 & 2 & 3\\ 2 & 3 & 2\\ 3 & 2 & 1 \end{bmatrix} $$ We are going to evaluate some exemplary properties of the matrices and check if the matrices are symmetric, both in the BoSSS framework and in Matlab.

2 Solution within the BoSSS framework

First, we have to initialize the new project:

We want to implement the two 3x3 matrices in BoSSSpad

Test for symmetry in BoSSS

To analyze if the matrices are symmetric, we need to compare the original matrix with the transpose:

The interface to Matlab

The BatchmodeConnector initializes an interface to Matlab:

Troubleshoot

In case that BoSSS cant find the path to matlab you will need to modify (if Matlab is installed) a file called MatlabConnectorConfig.json which you can find in your BoSSS binary under the following path:

cs
...\.BoSSS\etc\MatlabConnectorConfig.json

Inside the file add a path to your matlab.exe (e.g.): ```py { "MatlabExecuteable": "C:\ProgramFiles\MATLAB\R2021a\bin\win64\MATLAB.exe", "Flav": "Matlab" }

We have to transfer out matrices to Matlab:

And here are our results back in the BoSSSpad:

Test for symmetry within Matlab using the BatchmodeConnector

We do the same test for symmetry for both matrices. In Matlab we can use the convenient command isequal: