Unable to add S-function to MATLAB path when using "addpath"
7 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
MathWorks Support Team
le 16 Fév 2017
Réponse apportée : MathWorks Support Team
le 16 Fév 2017
I am experiencing an unusual issue where Simulink can't find a compiled S-Function, even when the folder that the function is located in is on the MATLAB path. I see an error saying "Double2Str.c cannot be found" or the like.
The commands I'm using to add the required folders to the MATLAB path are as follows :
addpath(genpath('apps/examples'));
addpath('lib');
addpath(genpath('robots'));
Réponse acceptée
MathWorks Support Team
le 16 Fév 2017
The commands you listed will not add the 'examples' folder located under 'apps' to the MATLAB path. This is because MATLAB R2016a does not implicitly add the path of the present working directory to the string arguments in "addpath", especially when you're trying to add subfolders. The commands you can use instead are as follows:
addpath(genpath([pwd '/apps/examples']));
addpath([pwd '/lib']);
addpath(genpath([pwd '/robots']));
Please note that in MATLAB R2016b, "addpath" implicitly adds the path of the present working directory. Therefore, the original commands would work in MATLAB R2016b.
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Startup and Shutdown dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!