Define variable inputs for function

2 ビュー (過去 30 日間)
Goryn
Goryn 2013 年 2 月 26 日
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 Center および File ExchangeSources についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by