v_m generates a 2 by 5 matrix. inside the for loop at the point after 'else'(basically when i==2), then i am getting an error saying : index exceeds matrix dimensions. why does it happen? when i manually write this: a=alpha0(2); i get the 2nd element of that matrix, but it does not seem to work when it is inside the loop.
alpha0=v_m(:,1);for i=1:2 if i==1 alpha0=alpha0(i); else alpha0=alpha0(i); endend
Best Answer