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 CenterFile Exchange에서 Sources에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by