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!