How do I know when to use loops and when to use vectorization?

1 visualizzazione (ultimi 30 giorni)
In this question, the solution is achieved by using a loop. I thought this could have been achieved only through vectors.
What is the rule of thumb regarding when to use loops and when to use vectors only?

Risposta accettata

Andrei Bobrov
Andrei Bobrov il 3 Ott 2017
sprintfc('%d,%d(%d)',mat)

Più risposte (0)

Categorie

Scopri di più su Loops and Conditional Statements in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by