unable to add namespace folder +toml to the project path

23 ビュー (過去 30 日間)
Sylvain
Sylvain 2025 年 10 月 27 日 10:59
コメント済み: Sylvain 2025 年 10 月 29 日 10:29
Greetings,
I am using the TOML file echange: matlab-toml - File Exchange - MATLAB Central
I have added it to my project as a github submodule. and I am trying to add it to my project.
Unfortunatelly, when I had the folder and the subfolders, I ame getting a project settings error messages. I bet this is caused by "+" in the folder path but I am not sure.
Alternatively I could install the file exchange on my MATLAB, but there I will need to do this for every machine I am working on, plus it will be like having 2 sources of truth.
Is this is a limitation of the Project Folder? How to solve this appart from using the FileEchange installation?
I am on MATLAB 2025a, but will upgrade to 2026a soon.
  2 件のコメント
Steven Lord
Steven Lord 2025 年 10 月 27 日 13:58
I ame getting a project settings error messages.
What is the full and exact text of the error message? Please show us all the text displayed in red in the Command Window (and if there are any warning messages displayed in orange, please show us those too.) The exact text may be useful and/or necessary to determine what's going on and how to avoid the warning and/or error.
I suspect that the cause of the error is what you suspect, since namespace folders cannot be added to the MATLAB search path. The contents of the namespace will be accessible to MATLAB so long as the folder containing the namespace folder is on the path. But seeing the exact error (and knowing whether this error is coming from MATLAB, from Github, etc.) will help confirm this or suggest an alternate cause.
Sylvain
Sylvain 2025 年 10 月 27 日 14:27
Here are the steps to reproduce the error:
  • Step 1: Add the submodule, (need to have initialised the repo and do a first commit before adding the submodule)
  • Step 2: Ass the new folder to the project (to access the functions), click project settings, and add with subfolders.
matlab-toml contains only the folder +toml. I tried also to add this folder "Add folder" manually and got the same error.

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

回答 (1 件)

Walter Roberson
Walter Roberson 2025 年 10 月 27 日 17:11
To be accessible to MATLAB, the parent folder of the namespace folder must be on the path. Trying to add the namespace folder itself to the path causes an error. For more information, see Namespaces and the MATLAB Path.
  1 件のコメント
Sylvain
Sylvain 2025 年 10 月 29 日 10:29
So I added a "startup.m" function which contain: addpath(pwd,"matlab-toml\")
I have run the code but still not able to add the folder with subfoders: matlab-toml
Note that I have added the startup in the "project startup", so the function should be called when opening the project.
Not a big deal, as the file-exchange is not usable, but still curious on the correct method to access the subfolders.

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

カテゴリ

Help Center および File ExchangeUsing MATLAB Projects in Simulink についてさらに検索

製品


リリース

R2025a

Community Treasure Hunt

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

Start Hunting!

Translated by