Multidimensional Array Conversion way

조회 수: 1 (최근 30일)
Faisal Memon
Faisal Memon 2014년 12월 23일
댓글: Faisal Memon 2014년 12월 23일
Is there any built in function or direct way to convert a 10 by 1e5 by 10 Array in to 100 by 1e5 array???

채택된 답변

Roger Stafford
Roger Stafford 2014년 12월 23일
A = reshape(permute(A,[1,3,2]),[],1e5);
  댓글 수: 1
Faisal Memon
Faisal Memon 2014년 12월 23일
Thank you Roger Stafford, it works.

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

추가 답변 (1개)

Guillaume
Guillaume 2014년 12월 23일
Use reshape:
in = rand(10, 1e5, 10);
out = reshape(in, 100, 1e5);
  댓글 수: 1
Faisal Memon
Faisal Memon 2014년 12월 23일
Dear Guillaume,
Thanks for the answer. But this command changes the data. I don't see orderly data. In first page of in array there are 10 rows and 1e5 columns. Keeping the data in the same place i want to change the array of 10 by 1e5 by 10 to 100 by 1e5, which reshape does not perform.

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

카테고리

Help CenterFile Exchange에서 Characters and Strings에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by