12 lines
249 B
Matlab
12 lines
249 B
Matlab
x = 1:10;
|
|
|
|
%% Erstellen eines logischen Vektors
|
|
y = x < 5;
|
|
fprintf('Logischer Vektor y:\n');
|
|
y
|
|
fprintf('Datentyp von y: %s\n', class(y));
|
|
|
|
%% Auswahl aller Element, die kleiner 5 sind
|
|
fprintf('\nAlle Elemente aus x, die kleiner als 5 sind:\n')
|
|
|
|
x(y) |