Can not create MATLAB string without MATLAB runtime being initialized.

22 ビュー (過去 30 日間)
Chuguang Pan
Chuguang Pan 2022 年 3 月 26 日
回答済み: Hitesh 2025 年 2 月 3 日 9:10
I create a .NET assembly using a function written in MATLAB. When I want to create a MATLAB String using MWStringArray Class, it generate a exception "Can not create MATLAB string without MATLAB runtime being initialized", but using MWCharArray Class is successful.
  1 件のコメント
Eddy
Eddy 2022 年 10 月 26 日
Have you solved this problem? I'm facing the same problem...

サインインしてコメントする。

採用された回答

Hitesh
Hitesh 2025 年 2 月 3 日 9:10
Hi Chuguang,
The error indicates that the environment variables for MATLAB are not correctly set. This typically involves ensuring that the MATLAB executable is in your system's PATH.
  • Open the Control Panel and go to System > Advanced system settings > Environment Variables.
  • Check if the MATLAB installation path is included in the PATH variable.
Ensure that you are using MATLAB functions correctly in your scripts. If you are using this function "matlab.lang.makeValidName", make sure it is supported by MATLAB version.
If the issue still persist, refer to the following MATLAB Answer for license related issue with MATLAB Run time:

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCOM Component Integration についてさらに検索

製品


リリース

R2020b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by