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.

조회 수: 2 (최근 30일)
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;.......]

채택된 답변

Iman Ansari
Iman Ansari 2013년 5월 18일
a=1:10
y=a(1:2:end)'
x=a(2:2:end)'

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by