Removing /eliminating bottom rows of a matrix

I have a matrix imat=[1 1 1 1 1 1 1 0 1 1 1 1 0 0 0 1 1 0 1 0 0 0 1 0 0]; and a matrix imat= [0 0 1 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 1 0 0 0 1 1 1 0 0 0 0 0 0] I want 'mat' matrix as the size of 'imat' matrix. mat size is 8X8 and mat=5X5. I want to remove the three rows of mat matrix. Can anyone help please.

 채택된 답변

William
William 2015년 11월 30일

0 개 추천

You named both matrices imat here. For 8x8 matrix named mat, for the first 5 columns and rows i.e. 5x5:
mat(1:5,1:5)

댓글 수: 1

Rutika Titre
Rutika Titre 2015년 11월 30일
hello Sir, It worked. Thanks a lot I was trying'[]'. What I wanted was mat (1:5,1:8). I got it my output.Thanks a lot.

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Multidimensional Arrays에 대해 자세히 알아보기

태그

질문:

2015년 11월 30일

댓글:

2015년 11월 30일

Community Treasure Hunt

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

Start Hunting!

Translated by