Filter löschen
Filter löschen

[Ask Help] - Convert Negative Commas Decimal into Single Binary

1 Ansicht (letzte 30 Tage)
Hilmi
Hilmi am 8 Dez. 2022
Kommentiert: Arif Hoq am 8 Dez. 2022
Hello,
Is anyone please could help me to convert this data from (Negative Commas Decimal).
Maximum set to '1' and other set to '0 or zero'.
This is my data:
data = [1.295175 -0.021158 -0.274017]
And i wanna convert into single binary like this :
data = [ 1 0 0 ]
Thanks.

Akzeptierte Antwort

Arif Hoq
Arif Hoq am 8 Dez. 2022
data = [1.295175 -0.021158 -0.274017];
data(data<0)=0;
data(data>1)=1
data = 1×3
1 0 0
  8 Kommentare
Hilmi
Hilmi am 8 Dez. 2022
Hohoho wow.
Thank a lot, Arif Hoq.
It's all work well.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Data Type Conversion 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!

Translated by