How to delete the last rows and columns?

조회 수: 1 (최근 30일)
Omar B.
Omar B. 2020년 2월 21일
댓글: Adam 2020년 2월 21일
How to delete the last three rows and three columns from the following matrix without change N and then multiply the last off diagonal by 6?
then how can we store the new matrix?
M = zeros(N,N);
>> M( 1:1+N:N*N) = a;
>> M(N+1:1+N:N*N) = b;
>> M( 2:1+N:N*N-N) = c
M =
-1 4 0 0 0 0 0 0 0 0
2 -1 4 0 0 0 0 0 0 0
0 2 -1 4 0 0 0 0 0 0
0 0 2 -1 4 0 0 0 0 0
0 0 0 2 -1 4 0 0 0 0
0 0 0 0 2 -1 4 0 0 0
0 0 0 0 0 2 -1 4 0 0
0 0 0 0 0 0 2 -1 4 0
0 0 0 0 0 0 0 2 -1 4
0 0 0 0 0 0 0 0 2 -1
  댓글 수: 2
darova
darova 2020년 2월 21일
What about this?
Adam
Adam 2020년 2월 21일
What is 'the last' off diagonal?

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Characters and Strings에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by