[programming] fix translations in m-files
This commit is contained in:
parent
0185e84735
commit
526cf222d6
@ -1,4 +1,4 @@
|
|||||||
x = rand(1); % eine einzelne Zufallszahl
|
x = rand(1); % draw a single random number
|
||||||
if x < 0.5
|
if x < 0.5
|
||||||
disp('x is less than 0.5');
|
disp('x is less than 0.5');
|
||||||
end
|
end
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
x = 1:10;
|
x = 1:10;
|
||||||
|
|
||||||
%% Erstellen eines logischen Vektors
|
%% creating a logical vector
|
||||||
y = x < 5;
|
y = x < 5;
|
||||||
fprintf('Logischer Vektor y:\n');
|
fprintf('Logical vector y:\n');
|
||||||
y
|
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
|
%% Select all elements that are less than 5
|
||||||
fprintf('\nAlle Elemente aus x, die kleiner als 5 sind:\n')
|
fprintf('\nAll elemente of x that are less than 5:\n')
|
||||||
|
|
||||||
x(y)
|
x(y)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
a = [2 4 6 8 10]; % Zeilenvektor mit 5 Elementen
|
a = [2 4 6 8 10]; % row vector with five elements
|
||||||
s = size(a) % Speicher den Rueckgabewert von size() in einer Variablen
|
s = size(a) % store the return value of size() in a new variable
|
||||||
s(2) % Inhalt der zweiten Zahl, d.h. Laenge der 2. Dimension
|
s(2) % get the second element of s, i.e. the length along the 2nd dimension
|
||||||
size(a,2) % Die kurze Alternative
|
size(a,2) % the shortcut
|
||||||
|
Reference in New Issue
Block a user