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{:});

```
Use eval:

```
astr = [];
for i=1:length(a)
    astr     = [astr,'a(',num2str(i),'),']; % a(1),a(2),...
end
astr  = astr(1:end-1);
eval(['func(' astr ');']);

```