27 lines
829 B
Matlab
27 lines
829 B
Matlab
%Zuweisung einer Variable
|
|
x = 3;
|
|
fprintf('x = %f\n', x);
|
|
|
|
%1. Bildung des Zehnerlogharitmus
|
|
y = log10(x);
|
|
fprintf('Bildung des Zehnerlogharitmus: y = log10(x) = %f\n', y);
|
|
|
|
%2. Bildung des natürlichen Logharitmus
|
|
y = log(x);
|
|
fprintf('Bildung des natürlichen Logharitmus: y = log(x) = %f\n', y);
|
|
|
|
%3. Runden auf den nächstgrößeren Integer-Wert
|
|
y = ceil(y);
|
|
fprintf('Runden auf den nächstgrößeren Integer-Wert: y = ceil(y) = %f\n', y);
|
|
|
|
%4. Bildung des Absolutbetrags
|
|
a = -5;
|
|
fprintf('a = %f\n', a);
|
|
a = abs(a);
|
|
fprintf('Bildung des Absolutbetrags: a = abs(a); = %f\n', a);
|
|
|
|
%5. Bildung des konjugiert komplexen Werts einer komplexen Zahl
|
|
Z = 7 + 9j;
|
|
fprintf('Z = %d + %dj\n', real(Z), imag(Z));
|
|
Z = conj(Z);
|
|
fprintf('Bildung des konjugiert komplexen Werts einer komplexen Zahl Z = conj(Z) = %d + %dj\n', real(Z), imag(Z)); |