From: Carlos Adrian Vargas Aguilera on
"Bruno Luong" <b.luong(a)fogale.fr> wrote in message
<fuauva$726$1(a)fred.mathworks.com>...
> "ra ti" <monarc_74_NOSPAM(a)yahoo.com> wrote in message
> <fuau1b$ac5$1(a)fred.mathworks.com>...
>
> >
> > function out = myfunc(x,varargin)
> >
> > now, to do ndgrid(2,1:4,3), I can do:
> >
> > [s1,s2,s3]=ndgrid(varargin{1},varargin{2},varargin{3}) and
> > then use sub2ind.
> >
>
> Use cell instead of variables.
>
> c=cell(size(varargin));
> [c{:}] = ...
>
> Bruno

Thank you bruno, just what I was looking for. I almost
decided to use eval!