|
"Luca Cerone" <luca_cerone#_remove_this#@yahoo.it> wrote in message <i0suvg$eou$1@fred.mathworks.com>...
> Hi everybody,
> I'm sorry if the question is silly,
> but I couldn't find in the help nor in the newsgroup.
>
> I've a vector v and have to assign its values to different variables,
> something like:
>
> a=v(1);
> b=v(2);
> c=v(3);
> .
> .
> .
> and so on.
>
> Is there any easy way to write such a piece of code?
> Thanks a lot in advance to you all.
> Cheers, -Luca
well... since you're a seasoned ML/CSSM user, let's assume you have very good reason for doing this...
one of the solutions
v=1:3;
v=num2cell(v);
[a,b,c]=deal(v{:})
% a = 1
% b = 2
% c = 3
us
|