Hey guys, I was wondering if somebody could help me with an issue related to 'varargin'. My main/outer function has a 'varargin'. And then, I have a nested function (a function for a SLIDER) that has a 'varargin' as well. Is it possible that I could access the varargin of the outer function, and use it inside the nested function? Thanks!

 채택된 답변

Bruno Luong
Bruno Luong 2020년 9월 5일
편집: Bruno Luong 2020년 9월 5일

0 개 추천

A varargin is just a cell. So pass it in the nested function as input argument
function outer(a, b, varargin)
function inner(c, d, outervarargin, varargin)
e = outervarargin{1};
piiii = varargin{1}
end
outervarargin = varargin;
inner('c', 'd', outervarargin, pi);
end
outer('a', 'b', 'e');

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Entering Commands에 대해 자세히 알아보기

제품

릴리스

R2017b

질문:

2020년 9월 5일

편집:

2020년 9월 5일

Community Treasure Hunt

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

Start Hunting!

Translated by