How can we write unsigned long value in matlab?
Afficher commentaires plus anciens
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

Réponse acceptée
Plus de réponses (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 commentaires
Imtiaz nabi
le 24 Fév 2022
Rik
le 24 Fév 2022
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.
Catégories
En savoir plus sur Logical dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!