Change Float or Double to Integer Data type

Hello everyone, i was have a project to process to change data float or integer to integer, because i have real time data with float and double data, and i want to change to integer data?, thank you

댓글 수: 3

KSSV
KSSV 2022년 6월 27일
Read about int32, int64
oke thank for your information
If you have real-time data: are you using Simulink to target a DSP or to target VHDL or FPGA ? If you are targetting embedded systems, then sometimes the way to go for real-time data is to use the Fixed Point Toolbox.

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

 채택된 답변

Lokesh
Lokesh 2022년 6월 27일
편집: Lokesh 2022년 6월 27일

1 개 추천

Float and double data can be changed to integer using int32 and int64 depending on how large the float/double number is.
Ex: If X is the number to be converted, then X can be converted to integer in this way :
X = int32(X) or X= int64(X)
(X is converted to integer and then the converted integer is stored back in X)

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Data Types에 대해 자세히 알아보기

제품

릴리스

R2017b

질문:

2022년 6월 27일

댓글:

2022년 6월 27일

Community Treasure Hunt

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

Start Hunting!

Translated by