![]() ![]() Vectorized operations are equivalent to for loops and all vectorized operations can be replaced with for loops. In fact what is happening is that 'single' command is applied over and over again to every element of the array. Example: Many matrix-vector productsįrequently we want to compute matrix-vector products for many vectors at once, such as when we compute \theta^\top x^ - y). Vector operations in Matlab allow you to apply a 'single' command to an entire array. (This is also useful for other languages, including Python and C/C - we want to re-use optimized operations when possible.)įollowing are some examples for how to vectorize various operations in MATLAB. Share Improve this answer Follow answered at 7:36 b3. Create your desired vectors using index, e.g. index find (sumsurface < 0.01
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |