MATLAB Easiest way to assign elements of a vector to individual variables.

Posted by rlbond on Stack Overflow See other posts from Stack Overflow or by rlbond
Published on 2010-05-23T20:38:10Z Indexed on 2010/05/23 20:40 UTC
Read the original article Hit count: 206

Filed under:

So let's say I have a vector p = [1 2 3]. I want a command that looks like this:

[x y z] = p;

so that x = p(1), y = p(2), and z = p(3).

Is there an easy way to do this?

© Stack Overflow or respective owner

Related posts about matlab