Script main_data.m
Download Script main_data.m
%----------------------------------------------------------
% DATA PROPERTIES n.1 M.file:main_data.m
%----------------------------------------------------------
%%
a=-3 % -3 is an array of size 1x1 and class double
b=single(a) % b is an array of size 1x1 and class single
%
% Values of a as signed integers
% of size 1x1 and class int8,int16,int32,int64
as8=int8(a);as16=int16(a);as32=int32(a);as64=int64(a)
% or as unsigned integers of size 1x1
% and class uint8,uint16,uint32,uint64
au8=uint8(a);au16=uint16(a);au32=uint32(a);au64=uint64(a)
%
% A complex number of size 1x1, class double
% and attribute complex
a_complex=3+2i
%
% array_date has size 1x6 and class uint16
% date and time have size 1x3 and class uint16
a_date=uint16(clock);date=a_date(1:3)
time=a_date(4:6)
%
% The binary 100000 corresponding to decimal 32
% becomes an array of size 1x6 and class char
a32=32;a_bin=dec2base(a32,2)
%
% A string as an array of size 1x14 and class char
a_string='red green blue'
%
% a_logical has size 1x1 and class logical
a2=2;a3=3;a_logical=a2==a3
%----------------------------------------------------------

Back