Unable to add S-function to MATLAB path when using "addpath"

7 ビュー (過去 30 日間)
MathWorks Support Team
MathWorks Support Team 2017 年 2 月 16 日
回答済み: MathWorks Support Team 2017 年 2 月 16 日
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'));

採用された回答

MathWorks Support Team
MathWorks Support Team 2017 年 2 月 16 日
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 件)

カテゴリ

Help Center および File ExchangeStartup and Shutdown についてさらに検索

製品


リリース

R2016b

Community Treasure Hunt

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

Start Hunting!

Translated by