Quantcast
Channel: MATLAB Central Newsreader Recent Posts
Viewing all articles
Browse latest Browse all 19628

one liner using deal()

$
0
0
I was trying to reduce these 7 commands to a single command:

x = s(1); y = s(2); z = s(3); ux = s(4); uy = s(5); uz = s(6); t = s(7);

The best I could think of was using these two commands:

ss = num2cell(s);
[x y z ux uy uz t] = deal(ss{:});

Is there a way to do that with a single command?

Thanks
~Paul

Viewing all articles
Browse latest Browse all 19628

Trending Articles