How to split an array into two arrays?

조회 수: 3 (최근 30일)
Mohammad Torabi
Mohammad Torabi 2020년 1월 20일
댓글: Mohammad Torabi 2020년 1월 20일
Hi,
I have an array like x = [ 0:10] and need to split it into x1 = [x(0,1),x(4,5),x(8,9)] and x2 = [x1(2,3),x(6,7)]. I am able to do this by using loops but for big dara is very time consuming. Is there any other way to do this?
Thanks
  댓글 수: 5
Stephen23
Stephen23 2020년 1월 20일
First reshape and then use indexing.
Mohammad Torabi
Mohammad Torabi 2020년 1월 20일
Thanks for your help. It works.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by