How can we write unsigned long value in matlab?
이전 댓글 표시
Hi there, I am trying to implement some steps from a C code and there is this "(double)" "(unsigned long)" thing which I really don't have any idea about. Can anyone please guide me if I have to write the exact code in matlab what would be the syntax?
Here is the example of the line that I wanted to implement

채택된 답변
추가 답변 (1개)
As I understand it, this would be a casting operation, equivalent to the Matlab function cast. (note that typecast changes the data type, but not the underlying bits, while cast will try to find the closest equivalent)
Since an unsigned long is an 8 byte integer, on systems with 8 bits per byte (virtually every computer nowadays), that amounts to 64 bits. So that would make it a uint64 in Matlab.
doc cast
doc typecast
댓글 수: 2
Imtiaz nabi
2022년 2월 24일
Rik
2022년 2월 24일
I suspect that's correct.
Your question doesn't actually seem a Matlab question. I looks like you don't understand the C code.
I hardly ever work with C. I suspect that '30UL' is casting the value 30 to an unsigned long, but I don't know.
카테고리
도움말 센터 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!