필터 지우기
필터 지우기

delete a row, or column.

조회 수: 2 (최근 30일)
ck
ck 2016년 7월 5일
댓글: ck 2016년 7월 5일
I have a matrix 'b' with 1201 rows and 1 column(1203x1), but the last row is not needed and I want to delete the last row making it (1200x1).
Can I use any function for this?
Thank you

채택된 답변

James Tursa
James Tursa 2016년 7월 5일
편집: James Tursa 2016년 7월 5일
Not sure if you have a 1201x1 or a 1203x1. But to delete the last row:
b(end,:) = [];
To retain the first 1200 rows:
b = b(1:1200,:);
If b is 1201x1 these will give the same result.
Since you have a column vector I really didn't need the : for the columns, but decided to include it since that form will work for a matrix also.
  댓글 수: 1
ck
ck 2016년 7월 5일
Thanks ! it helped!

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

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by