Use the cast function to cast a variable to be the same type as another variable
belongs to book: MATLAB: A Practical Introduction to Programming and Problem Solving|Stormy Attaway|Fourth Edition| Chapter number:1| Question number:24.1
All Answers
total answers (1)
>> vara = uint16(3 + 5) vara = 8 >> varb = 4*5; >> class(varb) ans = double >> varb = cast(varb, 'like', vara) varb = 20 >> class(varb) ans = uint16
need an explanation for this answer? contact us directly to get an explanation for this answer