# How to remove redundant elements in a sparse matrix?

1 visualizzazione (ultimi 30 giorni)
Souarv De il 14 Apr 2021
Commentato: Souarv De il 14 Apr 2021
I have the following Sparse Matrix E with the following redundant elements i.e (2,1) = (1,2), (5,1) = (1,5), (2,3)=(3,2) and (2,4) = (4,2)
E =
(2,1) 2.33
(5,1) 4.16
(1,2) 2.33
(3,2) 2.08
(4,2) 4.33
(1,5) 4.16
(2,3) 2.08
(2,4) 4.33
I want my sparse matrix output to be as follows
E =
(1,2) 2.33
(1,5) 4.16
(2,3) 2.08
(2,4) 4.33
##### 0 CommentiMostra -2 commenti meno recentiNascondi -2 commenti meno recenti

Accedi per commentare.

### Risposte (1)

Bruno Luong il 14 Apr 2021
E = triu(E);
##### 1 CommentoMostra -1 commenti meno recentiNascondi -1 commenti meno recenti
Souarv De il 14 Apr 2021
@Bruno Luong It's gives the result correct but not in the ascending order sequence. Can you do any further modification in it.

Accedi per commentare.

### Categorie

Scopri di più su Sparse Matrices in Help Center e File Exchange

R2018a

### Community Treasure Hunt

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

Start Hunting!

Translated by