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

1 回表示 (過去 30 日間)
Hilmi
Hilmi 2022 年 12 月 8 日
コメント済み: Arif Hoq 2022 年 12 月 8 日
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.

採用された回答

Arif Hoq
Arif Hoq 2022 年 12 月 8 日
data = [1.295175 -0.021158 -0.274017];
data(data<0)=0;
data(data>1)=1
data = 1×3
1 0 0
  8 件のコメント
Hilmi
Hilmi 2022 年 12 月 8 日
Hohoho wow.
Thank a lot, Arif Hoq.
It's all work well.
Arif Hoq
Arif Hoq 2022 年 12 月 8 日
my pleasure

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeData Type Conversion についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by