Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ep 5: poorly motivated example #202

Open
gcapes opened this issue Feb 5, 2019 · 1 comment
Open

Ep 5: poorly motivated example #202

gcapes opened this issue Feb 5, 2019 · 1 comment

Comments

@gcapes
Copy link
Contributor

@gcapes gcapes commented Feb 5, 2019

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.

A better example might be to calculate a series like the fibonacci which isn't easy to vectorise

@gcapes
Copy link
Contributor Author

@gcapes gcapes commented Feb 7, 2019

Note that the debugging gif will need re-doing if this example is changed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant