How can I replace integer values in a array?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
I Have some values in a array like this.
A = -4
-4
-4
4
4
4
I want to convert all negative values to 0 and all positive values to 1.
How can I do that.??
Outcome should be :
B = 0
0
0
1
1
1
0 Kommentare
Antworten (2)
Image Analyst
am 3 Jan. 2021
We already answered this in your other question:
B = double(A > 0)
0 Kommentare
Siehe auch
Kategorien
Mehr zu Numeric Types finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!