Page Programare si limbaje II Anul I, AR+ITT 1 Recapitulare Curs 2 ...
Page Programare si limbaje II Anul I, AR+ITT 1 Recapitulare Curs 2 ...
Page Programare si limbaje II Anul I, AR+ITT 1 Recapitulare Curs 2 ...
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
Conf.dr.ing. Ovidiu-Aurelian Deteşan – <strong>Programare</strong> <strong>si</strong> <strong>limbaje</strong> <strong>II</strong> <strong>Curs</strong> 3. Clase Matlab<br />
>> intmin('uint64')<br />
ans =<br />
0<br />
Observație. Toate clasele uint* au valoarea minimă zero.<br />
- determinarea limitelor maxime pentru clasele întregi cu semn:<br />
>> intmax('int8')<br />
ans =<br />
127<br />
>> intmax('int16')<br />
ans =<br />
32767<br />
>> intmax('int32')<br />
ans =<br />
2147483647<br />
>> intmax('int64')<br />
ans =<br />
9223372036854775807<br />
- determinarea limitelor maxime pentru clasele întregi cu semn:<br />
>> intmax('uint8')<br />
ans =<br />
255<br />
>> intmax('uint16')<br />
ans =<br />
65535<br />
>> intmax('uint32')<br />
ans =<br />
4294967295<br />
>> intmax('uint64')<br />
ans =<br />
18446744073709551615<br />
2.1.3 Clasa text (char)<br />
Un caracter în MATLAB este reprezentat printr-un întreg convertit în caracterul Unicode echivalent.<br />
Un şir de caractere: vector cu componente numerice, reprezentând caractere.<br />
Caracterele sau şirurile de caractere aparţin clasei char.<br />
2.1.3.1 Crearea unui <strong>si</strong>ngur caracter<br />
>>hChar = 'h'<br />
>>whos hChar<br />
Name Size Bytes Class Attributes<br />
hChar 1x1 2 char<br />
Valoarea numerică a lui hChar este:<br />
>>uint8(hChar)<br />
ans =<br />
104<br />
2.1.3.2 Crearea unui şir de caractere<br />
>>str = 'Hello';<br />
>>whos str<br />
Name Size Bytes Class Attributes<br />
str 1x5 10 char<br />
>>str_numeric = uint8(str)<br />
4 | P a g e