Any learning materials to practice vectorization ?

8 vues (au cours des 30 derniers jours)
ManvsMachine
ManvsMachine le 22 Mai 2019
Modifié(e) : John D'Errico le 22 Mai 2019
I would like to learn/study materials for matrix vectorization

Réponses (1)

KALYAN ACHARJYA
KALYAN ACHARJYA le 22 Mai 2019
If you regularly practice, you would learn more. I dont think, there may any specific materials, where you can get all trick to clear your doubts.
Better o practice with example, it would be much better, see matlab documentation here, in addition there are multiple example of matrix vectorization in this forum, like here.
Post question, tried on other question how this can be vectorize..gradually you can learn multiples ways.
I am also lerning the same, I tried to undestand from specific questions or examples.
  1 commentaire
John D'Errico
John D'Errico le 22 Mai 2019
Modifié(e) : John D'Errico le 22 Mai 2019
Yes. You learn by doing. You also learn by reading on this forum, where you will see various techniques used to vectorized operations.
But in the end, don't waste your time in just wanting to learn to vectorize everything. Sometimes a loop is entirely adequate. Only worry about vectorizeing code when it is clear the code has become a bottleneck in your code. And even then sometimes you need to accept that vectorized code is not always faster than a simple loop. Remember that vectorization often trades off use of additional memory for loops. And vectorization is just a fancy word for getting MATLAB to create internal, implicit loops to do something that at its core still requires the same amount of work. The gain can come in when those internal loops are more highly optimized than the explicit loops you would create otherwise.
SOME of the time, the word "vectorization" is applied to an alternative algotrithm to solve a problem in a mathematically intelligent way. Arguably, this is not vectorization at all, but merely a better choice of algorithm, perhaps based on the user knowing some theorem from mathematics to gain a leg up on an otherwise brute force solution.
The point being, that there are many things people call vectorization. They are not all truly vectorization as the word means. But much of the time it comes down to the use of either mathematical sophistication OR to programming sophistication to solve an otherwise difficult problem. And those are two things you learn from much time spent in the saddle, from much work invested.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Parallel Computing dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by