Revision history for OctaveIntegerArithmetic


Revision [11012]

Last edited on 2010-07-24 19:26:29 by ToBo
Additions:
a = uint8(0);
for i=1:10;
a=a+50;
disp(a);
end
Deletions:
%%(matlab)a = uint8(0); for i=1:10; a=a+50; disp(a); end%%


Revision [11011]

Edited on 2010-07-24 19:25:39 by ToBo
Additions:
=====Integer-Arithmetik unter Octave and MATLAB=====
Create a matrix containing Integer-Objects:
%%(matlab)
A = int8(randn(4,4)*10)
%%
||A*3||implemented||
||A.*A||implemented||
||A*A||not implemented||
Keine Möglichkeit die Eigenschaften von Rechenoperartionen einzustellen (z.B. Wahl zwischen Sättigung oder Überlauf bei Addition und Multiplikation)
Beispiel mit 16-Bit-Signed-Integer:
%%
>> a = int16(400)
a =
400
>> b = int16(1000)
b =
1000
>> a*b
ans =
32767
%%




Beispiel mit 8-Bit-Unsigned-Integer:
%%(matlab)a = uint8(0); for i=1:10; a=a+50; disp(a); end%%
Ausgabe:
50
100
150
200
250
255
255
255
255
255
Minimum und Maximum eines Integer-Wertes ermitteln.
Maximum
%%
intmax('int8')
ans =
127
%%

Minimum
%%
intmin('int8')
ans =
-128
%%
Deletions:
=====Titel=====


Revision [11010]

The oldest known version of this page was created on 2010-07-24 19:22:59 by ToBo
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki