From: mat001 on
Can some one explain me how this function works

if ((i == eq.n1) & (j == eq.n1) & (k == eq.n1))
switch varargin{3} % what is means ?
case 'x'
Aijk =
case 'y'
Aijk =
case 'z'
Aijk =
otherwise
error('unknown case');
end
else
error();
end

return
From: us on
"mat001 " <priya.biomath(a)gmail.com> wrote in message <hkref6$k8m$1(a)fred.mathworks.com>...
> Can some one explain me how this function works
>
> switch varargin{3} % what is means ?

arg=varargin{3};
% returns in ARG the CONTENT of the 3rd CELL of the CELL array VARARGIN...
% see also
help varargin;

us
From: Parker on
On 2月9日, 上午10时47分, "mat001 " <priya.biom...(a)gmail.com> wrote:
> Can some one explain me how this function works
>
> if ((i == eq.n1) & (j == eq.n1) & (k == eq.n1))
>   switch varargin{3}     % what is means ?
>    case 'x'
>     Aijk =
>    case 'y'
>     Aijk =
>     case 'z'
>    Aijk =
>    otherwise
>     error('unknown case');
>   end
> else
>   error();
> end
>
> return

check the third input parameter, if x,y,or z, assign it to Aijk,
otherwise raise error
From: mat001 on
function Aijk = Prob(i, j, k, parameter, varargin)
if ((i == eq.n1) & (j == eq.n1) & (k == eq.n1))
switch varargin{3} % what is means ?
case 'x'
Aijk =
case 'y'
Aijk =
case 'z'
Aijk =
otherwise
error('unknown case');
end
else
error();
end

return


Parker little more explain plz.
From: mat001 on
error occurs


??? SWITCH expression must be a scalar or string constant.
 |  Next  |  Last
Pages: 1 2 3
Prev: Enumeration
Next: Radon Transform