Vectorization Over Loops
Cephas
on 11 Nov 2025 at 19:50
Latest activity Reply by Mohammad Aryayi
on 12 Nov 2025 at 14:13
I realized that using vectorized logic instead of nested loops makes Cody problems run much faster and cleaner. Functions like any(), all(), and logical indexing can replace multiple for-loops easily !
1 Comment
Time DescendingYes, it's true for all of the language like Matlab or Python. On the other hand, using prebuilt functions usually are more fast than writing them again, because they have been optimized.
But honestly in Cody that it's just for exercise, sometimes writing some lines of code is more cool than just search and find some non common funtions in Matlab!
Sign in to participate