unable to add namespace folder +toml to the project path

19 visualizaciones (últimos 30 días)
Sylvain
Sylvain el 27 de Oct. de 2025 a las 10:59
Comentada: Sylvain hace alrededor de 21 horas
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 comentarios
Steven Lord
Steven Lord el 27 de Oct. de 2025 a las 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 el 27 de Oct. de 2025 a las 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.

Iniciar sesión para comentar.

Respuestas (1)

Walter Roberson
Walter Roberson el 27 de Oct. de 2025 a las 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 comentario
Sylvain
Sylvain hace alrededor de 5 horas
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.

Iniciar sesión para comentar.

Categorías

Más información sobre Using MATLAB Projects in Simulink en Help Center y File Exchange.

Productos


Versión

R2025a

Community Treasure Hunt

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

Start Hunting!

Translated by