Nested Loop, Can someone help me to understand this code?
Mostrar comentarios más antiguos
Inspect the (basic) functionality of the cumsum function, then implement your own (mycumsum). Only implement the functionality of the first 3 documentation lines, not all the special cases!
function Y = mycumsum(X)
%MYCUMSUM cumulative sum of elements.
Y = X;
[r,c] = size(Y);
for ii = 2:r
for jj = 1:c
Y(ii,jj) = Y(ii,jj) + Y(ii-1,jj);
end
end
end
Can someone help me to understand this code?
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Naming Conventions 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!