-
-
Notifications
You must be signed in to change notification settings - Fork 67
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
Include vectorization #19
Comments
Where do you thing vectorization should go? Before or after loops? |
The MATLAB folks think vectorization should come first, and loops later
|
I think it's worth having learners use both approaches to accomplish the same task, have them understand why vectorization is generally a better idea, and also when it becomes necessary to use a for loop. The challenge will be making sure all of this doesn't stick out awkwardly in the lessons :) |
We now have a screenshot of MATLAB, and a gif of debugging. |
Some thoughts: In ep5 (loops) some of the examples would be much better achieved using whole-array operations e.g. printing each letter in a word, summing all the elements of an array etc. So while they're poorly-motivated examples of loops, they are easy to follow examples, and give a natural motivation for vectorization. We could show how some of these examples could be achieved using vectorization, and come up with an example which doesn't vectorize before looping over files (which also doesn't vectorize). |
I'm interested in having a crack at adding some vectorization material to the lessons as I think it's an important part of using MATLAB. @gcapes - these are great suggestions. I think it's sensible to introduce vectorization in the arrays lesson, but although the lesson is short the array indexing material is conceptually dense. I'll add some material and we can see how it looks. |
Would be good to see your ideas. Perhaps it might be useful to refer back to |
Multiple changes based on converting Make lesson to template
In a discussion with Ken Deeley and Jos Martin from Mathworks, and @gvwilson, the following improvements to the SWC MATLAB material have been suggested:
The text was updated successfully, but these errors were encountered: