Can i use quadruple for loop?
2 ビュー (過去 30 日間)
古いコメントを表示
I need to make a swap between two variables of different row of a matrix and i think to use quadruple for to do it.Is it ok,or it will slow down a lot my programme?
1 件のコメント
Joseph Cheng
2015 年 4 月 29 日
It probably would not slow down the programme as the number of iterations would be the same. however can you dumb your implementation down to a simple example. Perhaps the collective minds here can come up with an easier way.
回答 (1 件)
Image Analyst
2015 年 4 月 29 日
How many iterations in each for loop? Unless you're doing tens or hundreds of millions of iterations in the innermost part, you probably won't notice any slowdown. Whether it can be vectorized really depends on what "swap between two variables of different row of a matrix". I have no idea what that means. Maybe you can illustrate with a small 4 by 5 matrix.
2 件のコメント
Image Analyst
2015 年 4 月 29 日
19,600 iterations will happen faster than the blink of an eye. Don't worry about it.
参考
カテゴリ
Help Center および File Exchange で Matrix Indexing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!