How can I copy all elements, which > 4 to vector V?

1 visualizzazione (ultimi 30 giorni)
I have a M = magic(5) matrix. How can I copy all elements, which > 4 to vector V?

Risposta accettata

Abhinav
Abhinav il 17 Gen 2023
M = magic(5);
V=M(M>4)

Più risposte (0)

Categorie

Scopri di più su Computational Geometry 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