Day 2
Day 2
• Display the
minimum and
maximum
positive values
that can be
represented in
single precision.
Cast
• B = cast(A,newclass) returns the data in A converted to
the data type (class) newclass, where newclass is the name
of a built-in data type compatible with A. Any values in A
that are outside the range of newclass are truncated in B
to the nearest endpoint.
• Convert int8
values to uint8. -
Define a vector
of 8-bit integers.
Convert a to
unsigned 8-bit
integers. The –5
value outside the
range of uint8 is
truncated to 0.
Convert vector to existing datatype
Convert matrix to existing datatype
• Create a row
vector and
determine
which
elements are
NaN.
Steps to replace NaN values
• Explore all the query types and set example for each
Reference -
https://in.mathworks.com/help/matlab/numeric-
types.html
Numeric value limits
• eps - Floating-point relative accuracy
• flintmax - Largest consecutive integer in floating-point format
• Inf - Create array of all Inf values
• intmax - Largest value of specific integer type
• intmin - Smallest value of specific integer type
• NaN - Create array of all NaN values
• realmax - Largest positive floating-point number
• realmin - Smallest normalized floating-point number
Characters and Strings
Character arrays and string arrays provide storage for text data in
MATLAB®.