Simple Question about Optimization of a FOR loop
1 view (last 30 days)
Show older comments
How can I optimize (vectorize?) the following code in order to avoid the for loop and make the code to run faster?
A is 1 x 55 and B is 165 x 1
Laila Kazemi on 14 Jun 2013
C= B*3 +1 A (1:55, 1:55)= C(1:55, 1)
but the dimensions of ur matrices dont match , if B was 55 by 1 , it would have worked
Andrei Bobrov on 14 Jun 2013
A(1,:) = B((0:size(A,2)-1)*3+1);
Find more on Loops and Conditional Statements in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!