필터 지우기
필터 지우기

Rearranging matrix of sth elements

조회 수: 3 (최근 30일)
maria
maria 2022년 11월 30일
답변: David Hill 2022년 11월 30일
Dear community,
I have a 1x1716 array that I would like to rearrange but I also would like to keep the 1x1716 matrix shape. I need to take a cell every 66th position and after finishing going on starting in position 2 and then 67 (1+66),133,199, etc... and continue with position 3, 68,134,200, etc... Could you help me?
I can write an example with a simpler matrix arranged every 3rd position instead of 66:
A=[1 2 3 4 5 6 7 8 9 10]
B=[1 4 7 10 2 5 8 3 6 9]

채택된 답변

David Hill
David Hill 2022년 11월 30일
n=1:1716;
N=[];
for k=1:66
N=[N,n(k:66:end)];
end

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Multidimensional Arrays에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by