Unable to open custom file while building model in Linux

2 ビュー (過去 30 日間)
Shardul Kulkarni
Shardul Kulkarni 2024 年 5 月 21 日
回答済み: Dhruv 2024 年 5 月 28 日
I'm trying to build a model in Linux environment. But it throws error as unable to open source file. This error is for a custom header file, which is verified to be present in the path (not current path).
I have tried to build the same model in Windows environment, where is builds without any issues.
Does anyone have solution to this problem? Thanks in advance.
P.S. I'm using MATLAB R2022b.

回答 (1 件)

Dhruv
Dhruv 2024 年 5 月 28 日
Hi Shardul,
To help resolve the issue, here are some steps which you can follow that might help you:
  • Check for Case Sensitivity: Linux filesystems are case-sensitive, unlike Windows. Ensure the case of your file path and the file name in your MATLAB code exactly match the actual path and file name.
  • Check File Permissions: Ensure that the file permissions on the custom header file and its directory allow MATLAB to read them. You can check the permissions using the ‘ls -l’ command in the terminal and modify them using the ‘chmod’ command if necessary.
  • MATLAB Preferences and Cache: Sometimes, MATLAB's internal preferences or cache can cause issues. Try clearing MATLAB's cache and resetting preferences to see if this resolves the issue. Refer to the following documentation to get more information: https://www.mathworks.com/help/matlab/ref/rehash.html
  • Update MATLAB Path: Ensure that MATLAB's internal path (not the system $PATH variable) includes the directory containing your header file. You can add paths to MATLAB's search path using the ‘addpath’ function. The following link will help guide you with the same: https://www.mathworks.com/help/matlab/ref/addpath.html
However, if you are still encountering issues, you may reach out to MathWorks Technical Support as they will assist you further.
Hope this helps!

カテゴリ

Help Center および File ExchangeSimulink Coder についてさらに検索

製品


リリース

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by