I have a matrix which is [y1 x1 y2 x2 y3 x3.......]. The size variable depends on the input, I wanna extract y(i) and x(i) seperately from this matrix.

3 vues (au cours des 30 derniers jours)
m=[y1,x2,y2,x2,y3,x3,.......] I wanna extract y(i) as y_column=[y1;y2;y3;y4;....] and x_column=[x1;x2;x3;x4;.......]

Réponse acceptée

Iman Ansari
Iman Ansari le 18 Mai 2013
a=1:10
y=a(1:2:end)'
x=a(2:2:end)'

Plus de réponses (0)

Catégories

En savoir plus sur Matrices and Arrays dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by