How to run .net app with using matlab dll?
6 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hi, I'm using the matlab interface for .net 6, so I tried to do everything as stated here
My project file:

My Program.cs file:

When I run application an error pops up:

So I added to my project file this:

and this happening:

What did I do wrong?
0 comentarios
Respuestas (1)
colordepth
el 19 de Feb. de 2025
The encountered "MATLABNotAvailableException" error suggests that your PATH environment variable might not be set correctly to find the MATLAB installation. Since you are on a Windows machine, make sure that the directory "<matlabroot>\extern\bin\win64" is included in your system PATH. Replace "<matlabroot>" with the actual path to your MATLAB installation, which might look like 'C:\Program files (x86)\MATLAB\R2022b'. You can find the correct path by running the "matlabroot" command in MATLAB. More details on this command are available at: https://www.mathworks.com/help/releases/R2022b/matlab/ref/matlabroot.html.
To modify your system PATH variable, follow the instructions provided here: https://www.mathworks.com/matlabcentral/answers/223482-how-do-i-set-add-or-change-environment-variables.
It seems you tried to resolve the error by directly referencing DLLs in your C# project file, which could lead to further complications. I suggest removing those direct DLL references from your project. Setting the system path is the recommended method and should resolve the issue without needing those additional references.
0 comentarios
Ver también
Categorías
Más información sobre Call MATLAB from .NET en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!