Closed gcapes closed 3 years ago
This is the second example of a loop which is given.
LOOP_DEMO Demo script to explain loops len = 0 for vowel = 'aeiou' len = len + 1; end disp(['Number of vowels: ', num2str(len)])
It's not very realistic because you'd be better just using the length() function.
length()
A better example might be to calculate a series like the fibonacci which isn't easy to vectorise
Note that the debugging gif will need re-doing if this example is changed.
Fixed in #232
This is the second example of a loop which is given.
It's not very realistic because you'd be better just using the
length()
function.A better example might be to calculate a series like the fibonacci which isn't easy to vectorise