merge parameter inside a function

조회 수: 8 (최근 30일)
Gabriele
Gabriele 2013년 2월 5일
Dear all,
would it be possible inside a function to merge all the arguments (that in my case are cell array) in a cell array?
I would like something like this
function try(cellarray1, cellarray2, cellarray3)
for i = 1:nargin
LegendCellArray = inputname(i);
MergedCellArray = putthisparamenterinside(i);
end
end
Thanks Gabriele
  댓글 수: 2
Gabriele
Gabriele 2013년 2월 5일
편집: Gabriele 2013년 2월 5일
Solved...
function try(varargin)
for i = 1:nargin
LegendCellArray(i) = inputname(i);
MergedCellArray{i} = varargin{i};
end
end
José-Luis
José-Luis 2013년 2월 5일
Please place this as an answer so it can be accepted.

댓글을 달려면 로그인하십시오.

채택된 답변

Gabriele
Gabriele 2013년 2월 5일
Solved...
function try(varargin)
for i = 1:nargin
LegendCellArray(i) = inputname(i);
MergedCellArray{i} = varargin{i};
end
end

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by