Maintain data type during variable assignment
Afficher commentaires plus anciens
Hello,
Let's say I have the following code:
a = uint32(1);
a = 2; % Changes the type back to double
What is the sytanx for preserving the existing uint32 data type IF I didn't want to keep doing uint32() casts on all new data. I remember in the past there was something like:
a := 2;
% or
a ?= 2;
% BUT THESE ARE BOTH WRONG
But I can't for the life of me find the right assignment operator that did this.
Anyone know how to do this?
Réponse acceptée
Plus de réponses (0)
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!