How to find package functions that are shadowed?

조회 수: 7 (최근 30일)
per isakson
per isakson 2021년 10월 11일
I'm missing something.
It is possible to have several package functions with identical fully qualified names, e.g. p1.test, on the search path. The statement
which( 'p1.test', '-all' )
should be the way to discover shadowed package functions. However, I fail to make that work. This script below illustrates my problem. which() finds only one of the two p1.test
%%
addpath( cd )
mkdir( cd, '+p1' );
mkdir( fullfile(cd,'f1'), '+p1' );
addpath(fullfile('.','f1'));
str2txt( fullfile(cd,'+p1','test.m'), '% test' );
str2txt( fullfile(cd,'f1','+p1','test.m'), '% test' );
%%
cd ..
which( 'p1.test', '-all' )
/users/mss.system.iBN0QN/f1/+p1/test.m % static method or package function
%%
function str2txt( ffs, str )
fid = fopen( ffs, 'wt' );
fprintf( fid, '%s', str );
fclose( fid );
end

답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Import and Export에 대해 자세히 알아보기

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by