outputnames

버전 1.0.0 (2.09 KB) 작성자: Matt J
Get a list of the output argument names of the currently executing function.
다운로드 수: 20
업데이트 날짜: 2022/12/1

라이선스 보기

Somewhat analogous to inputname, the outputnames() command in this submission returns a cell array containing the output variable names for the current function call. There are important caveats, however, see below.
EXAMPLE:
>> [A, ~, C]=func()
A =
'a'
C =
'c'
function varargout=func()
varargout=lower(outputnames);
end
CAVEATS:
1. The line of code or the command line where the function call is
made must contain no other commands. The above example would fail,
had we done,
[A,B]=func(); [C,D]=func()
2. Function calls where the outputs contain indexing expressions
will have unjpredicatable behavior, e.g.,
[A{1,2}]=func()

인용 양식

Matt J (2024). outputnames (https://www.mathworks.com/matlabcentral/fileexchange/121487-outputnames), MATLAB Central File Exchange. 검색 날짜: .

MATLAB 릴리스 호환 정보
개발 환경: R2022b
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
태그 태그 추가

Community Treasure Hunt

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

Start Hunting!
버전 게시됨 릴리스 정보
1.0.0