Access outer varargin inside a nested function
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Debabrata Ghosh
am 5 Sep. 2020
Bearbeitet: Bruno Luong
am 5 Sep. 2020
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!
0 Kommentare
Akzeptierte Antwort
Bruno Luong
am 5 Sep. 2020
Bearbeitet: Bruno Luong
am 5 Sep. 2020
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 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Entering Commands finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!