필터 지우기
필터 지우기

[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.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Type Conversion에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by