Replace even element with zero
21 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Hi.
I am trying to replace even elements in my matrix with zero like below:
a = [3 5 4 1 2]
enter magical code here
a = [3 5 0 1 0]
Any help would be greatly appreciated
1 Commento
Risposte (1)
KALYAN ACHARJYA
il 22 Nov 2020
Modificato: KALYAN ACHARJYA
il 22 Nov 2020
"I am trying to replace even elements in my matrix with zero like below:"
a(2:2:end)=0
But the example is different ??
a = [3 5 0 1 0]
2 Commenti
Vedere anche
Categorie
Scopri di più su Resizing and Reshaping Matrices 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!