MATLAB Answers

Goryn
0

Define variable inputs for function

Asked by Goryn
on 26 Feb 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?

  0 Comments

Sign in to comment.

2 Answers

Answer by Goryn
on 1 Apr 2013
 Accepted Answer

  0 Comments

Sign in to comment.


Answer by Azzi Abdelmalek
on 26 Feb 2013

you can use a cell array
v={fts1,fts2,...,ftsn}
and use
function newfts = merge(v)

  1 Comment

Goryn
on 26 Feb 2013
No, I've tried. It doesn't work. It writes: "Undefined function 'merge' for input arguments of type 'cell'."

Sign in to comment.