Question: 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] gives same result)

then:

***func(a)***

gives me:

*??? Error ==> func at 11
 Not enough input arguments.*

Line 11 in func.m is:

***error(nargchk(5, 6, nargin));***

I notice that this works perfectly:

***func(a(1),a(2),a(3),a(4),a(5))***

How can I use the vector 'a' as a parameter to a function? I have another function otherfunc(b) which returns a, and would like to use its output as a paramater like this ***func(otherfunc(b))***.

Answer: 
[Comma-seperated lists](http://www.mathworks.com/help/matlab/matlab_prog/comma-separated-lists.html?refresh=true) 
(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.

It can be generated using cell array like this:

```
a=[1,2,3,4,5];
c = num2cell(a);
func(c{:});

```
Since arguments to functions in Matlab can themselves be vectoes (or even matrices) you cannot replace several arguments with a single vector.  

If `func` expects 5 arguments, you cannot pass a single vector and expect matlab to understand that all five arguments are elements in the vector. How can Matlab tell the difference between this case and a case where the first argument is a 5-vector?

So, I would suggest this solution

```
s.type = '()';
s.subs = {1:5};
func( subsref( num2cell( otherfunc(b) ), s ) )

```

I'm not sure if this works (I don't have matlab here), but the rationale is to convert the 5-vector `a` (the output of `otherfunc(b)`) into a cell array and then expand it as 5 different arguments to `func`.  

Please not the difference between `a{:}` and `a(:)` in this `subsref`.