Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
one liner using deal()

Subject: one liner using deal()

From: Paul Mennen

Date: 14 Mar, 2013 18:51:06

Message: 1 of 1

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

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us