Define variable inputs for function

16 visualizaciones (últimos 30 días)
Goryn
Goryn el 26 de Feb. de 2013
Hello,
could you please help me with the next problem.
I'm trying to merge N financial time series objects by
function newfts = merge(fts1, fts2, ..., ftsx).
How may I define a variable inputs for that? Because, when I have 2 time seriesobjects it becomes:
newfts = merge(fts1, fts2);
When I have 3:
newfts = merge(fts1, fts2, fts3);
How to avoid of examination of all posible options?

Respuesta aceptada

Goryn
Goryn el 1 de Abr. de 2013

Más respuestas (1)

Azzi Abdelmalek
Azzi Abdelmalek el 26 de Feb. de 2013
you can use a cell array
v={fts1,fts2,...,ftsn}
and use
function newfts = merge(v)
  1 comentario
Goryn
Goryn el 26 de Feb. de 2013
No, I've tried. It doesn't work. It writes: "Undefined function 'merge' for input arguments of type 'cell'."

Iniciar sesión para comentar.

Categorías

Más información sobre Workspace Variables and MAT Files en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by