Lösungen der Aufgaben rüberkopiert.
This commit is contained in:
27
MATLAB/Uebungen/01 Erste Schritte/Aufgabe 1/Aufgabe1_f.m
Normal file
27
MATLAB/Uebungen/01 Erste Schritte/Aufgabe 1/Aufgabe1_f.m
Normal file
@@ -0,0 +1,27 @@
|
||||
%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));
|
||||
Reference in New Issue
Block a user