summation inside for loop
Mostrar comentarios más antiguos
Have a good day. I am trying to find an easy way of writing a loop below:
v=rand(100,3)
for iz=1:3
for iznext=1 expv(:,iz)=v(:,iz)*Q_z(iz,iznext)+v(:,iz)*Q_z(iz,iznext+1)+v(:,iz)*Q_z(iz,iznext+2);
end
end
Thanks in advance.
Respuestas (1)
Torsten
el 21 de Jul. de 2021
0 votos
vec = ones(1,5)*Q_z.' ;
exp2(1:100,:) = vec ;
1 comentario
Mert Demir
el 21 de Jul. de 2021
Categorías
Más información sobre Loops and Conditional Statements en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!