How to delete the last rows and columns?

1 visualizzazione (ultimi 30 giorni)
Omar B.
Omar B. il 21 Feb 2020
Commentato: Adam il 21 Feb 2020
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 Commenti
darova
darova il 21 Feb 2020
What about this?
Adam
Adam il 21 Feb 2020
What is 'the last' off diagonal?

Accedi per commentare.

Risposte (0)

Categorie

Scopri di più su Characters and Strings in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by