Define variable inputs for function

2 次查看(过去 30 天)
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?

采纳的回答

Goryn
Goryn 2013-4-1

更多回答(1 个)

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

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Sources 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by