Help!!!!!!!! How to replace all the zeros in an array with -1?

160 visualizzazioni (ultimi 30 giorni)
X = [1 0 0 0 1 0 0 1 1 0 1 0 1 1 1] i want to replace all zeros with -1 in array. anybody can help ?

Risposta accettata

KSSV
KSSV il 16 Apr 2018
X(X==0) = -1 ;

Più risposte (1)

Stephen23
Stephen23 il 16 Apr 2018

Categorie

Scopri di più su Test and Measurement in Help Center e File Exchange

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by