If I call a matlab function with: func(1,2,3,4,5) it works perfectly.
But if I do: a=[1,2,3,4,5] %(a[1;2;3;4;5
Comma-seperated lists (CSL) can be passed to functions as parameter list,
so what you need is a CSL as 1,2,3,4,5 constructed from an array.
1,2,3,4,5
It can be generated using cell array like this:
a=[1,2,3,4,5]; c = num2cell(a); func(c{:});