필터 지우기
필터 지우기

Creating a new matrix from an existing matrix

조회 수: 45 (최근 30일)
Claire
Claire 2015년 1월 21일
댓글: Claire 2015년 1월 21일
My original matrix is a 4x6 matrix. However, I need to extract part of this matrix to make a new 3x4 matrix. For this new matrix, I only need the first, second, and fourth row and the first, second, fourth, and sixth columns from the original matrix. How would I go about creating this new matrix? Thank you!

채택된 답변

Image Analyst
Image Analyst 2015년 1월 21일
편집: Image Analyst 2015년 1월 21일
m2 = m([1,2,4],:); % Extract rows 1, 2, and 4;
m2 = m2(:, [1, 2, 4, 6]); Now extract columns 1,2,4,& 6
  댓글 수: 1
Claire
Claire 2015년 1월 21일
Thank you so much! It worked perfectly!

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

추가 답변 (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