The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: one liner using deal()
Replies: 0  

Advanced Search

Back to Topic List Back to Topic List  
Paul Mennen

Posts: 311
Registered: 12/7/04
one liner using deal()
Posted: Mar 14, 2013 2:51 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

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?


Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.