merge parameter inside a function

8 visualizaciones (últimos 30 días)
Gabriele
Gabriele el 5 de Feb. de 2013
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 comentarios
Gabriele
Gabriele el 5 de Feb. de 2013
Editada: Gabriele el 5 de Feb. de 2013
Solved...
function try(varargin)
for i = 1:nargin
LegendCellArray(i) = inputname(i);
MergedCellArray{i} = varargin{i};
end
end
José-Luis
José-Luis el 5 de Feb. de 2013
Please place this as an answer so it can be accepted.

Iniciar sesión para comentar.

Respuesta aceptada

Gabriele
Gabriele el 5 de Feb. de 2013
Solved...
function try(varargin)
for i = 1:nargin
LegendCellArray(i) = inputname(i);
MergedCellArray{i} = varargin{i};
end
end

Más respuestas (0)

Categorías

Más información sobre Logical en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by