[programming] fix translations in m-files

This commit is contained in:
Jan Grewe 2017-10-16 22:33:42 +02:00
parent 0185e84735
commit 526cf222d6
3 changed files with 11 additions and 11 deletions

View File

@ -1,4 +1,4 @@
x = rand(1); % eine einzelne Zufallszahl
x = rand(1); % draw a single random number
if x < 0.5
disp('x is less than 0.5');
end

View File

@ -1,12 +1,12 @@
x = 1:10;
%% Erstellen eines logischen Vektors
%% creating a logical vector
y = x < 5;
fprintf('Logischer Vektor y:\n');
fprintf('Logical vector y:\n');
y
fprintf('Datentyp von y: %s\n', class(y));
fprintf('Data type of y: %s\n', class(y));
%% Auswahl aller Element, die kleiner 5 sind
fprintf('\nAlle Elemente aus x, die kleiner als 5 sind:\n')
%% Select all elements that are less than 5
fprintf('\nAll elemente of x that are less than 5:\n')
x(y)

View File

@ -1,4 +1,4 @@
a = [2 4 6 8 10]; % Zeilenvektor mit 5 Elementen
s = size(a) % Speicher den Rueckgabewert von size() in einer Variablen
s(2) % Inhalt der zweiten Zahl, d.h. Laenge der 2. Dimension
size(a,2) % Die kurze Alternative
a = [2 4 6 8 10]; % row vector with five elements
s = size(a) % store the return value of size() in a new variable
s(2) % get the second element of s, i.e. the length along the 2nd dimension
size(a,2) % the shortcut