필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

how to eliminate matrix?

조회 수: 1 (최근 30일)
omer
omer 2013년 4월 18일
마감: MATLAB Answer Bot 2021년 8월 20일
ex [ 1 4 6 8 9; 5 7 9 5 3; 6 8 2 4 7; 4 3 2 1 0;] how can I do like this [ 1 4 6 8 9; 5 0 0 0 0; 6 0 2 4 7; 4 0 2 1 0;] or [ 0 0 0 0 0; 0 7 9 5 3; 0 8 2 4 7; 0 3 2 1 0;]
  댓글 수: 1
Cedric
Cedric 2013년 4월 18일
I would recommend the official documentation:
Under MATLAB, you could get..
  • PDF labeled "MATLAB Primer" and study chapters 2 and 5.
  • PDF labeled "Mathematics", and train to have a good mastery of chapters 1 and 9.
  • PDF labeled "Programming Fundamentals" and have a look at the table of content so you can use it as a reference later.
The first two references will teach you how to index blocks of matrices. It's a good investment of your time to train a bit indexing. I am sure that after no more than 20-30 minutes spent on these references, you will know how to answer your question.

답변 (1개)

Desiree Phillips
Desiree Phillips 2013년 4월 18일
편집: Desiree Phillips 2013년 4월 18일
This is a matter of matrix indexing techniques: see Matrix Indexing for details. If
A = [ 1 4 6 8 9; 5 7 9 5 3; 6 8 2 4 7; 4 3 2 1 0;]
Get [ 1 4 6 8 9; 5 0 0 0 0; 6 0 2 4 7; 4 0 2 1 0;] by using
A(2,2:end) = 0; % (Second row, Entries 2 to the end)
For [ 0 0 0 0 0; 0 7 9 5 3; 0 8 2 4 7; 0 3 2 1 0;] use
A(1,:) = 0; % Colon by itself means entire row
To eliminate the row, use [] instead of 0.

이 질문은 마감되었습니다.

태그

Community Treasure Hunt

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

Start Hunting!

Translated by