How do I avoid using for loop and vectorize when the i+1 th element of the array depends on the ith

I want to do the following without the for loop
x=zeros(size(RB_all_m,1),1);
y=zeros(size(RB_all_m,1),1);
index_1=zeros(size(RB_all_m,1),1);
x=sum(indices(1:690,:).*RB_all_m(2:691,:),2);
y=sum(indices(1:691,:).*RB_all_m(1:691,:),2);
for i=1:(size(RB_all_m,1)-1),
index_1(i+1) = index_1(i)*x(i)./y(i);
end

Categories

Find more on Loops and Conditional Statements in Help Center and File Exchange

Asked:

on 28 Sep 2012

Community Treasure Hunt

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

Start Hunting!