필터 지우기
필터 지우기

Reduce Matrix by Adding Every Nth Rows and Nth Columns

조회 수: 7 (최근 30일)
Michelle De Luna
Michelle De Luna 2020년 6월 2일
댓글: Michelle De Luna 2020년 6월 2일
Good morning everyone!
I was hoping for suggestions regarding a matrix reduction problem. I have a matrix that is 8000 x 4000. I would like to produce a new matrix that is 400 x 100 by adding every nth rows and nth columns. That is, I would like to reduce the number of rows from 8000 to 400 by adding every twenty rows, and I would also like to reduce the number of columns from 4000 to 100 by adding every 40 columns. Is there a direct way of doing this? I've tried to reshape the matrix, but the new matrix produced would have the same size as the original. (I'm pretty sure it's rather easy, but I can't seem to function too well at this moment...)
Any help would be greatly appreciated! Thanks for everything!
  댓글 수: 2
madhan ravi
madhan ravi 2020년 6월 2일
how many submatrices do you want to create from 8e3 X 4e3?
Michelle De Luna
Michelle De Luna 2020년 6월 2일
Madhan Ravi, thank you for the follow-up question. David pointed out a rather simple solution. Again, thank you for your help!

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

채택된 답변

David Hill
David Hill 2020년 6월 2일
m=m(1:20:8000,1:40,4000);
  댓글 수: 1
Michelle De Luna
Michelle De Luna 2020년 6월 2일
David, thank you for your quick response! I appreciate your help! As always, thank you!

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

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by