Hey @swarnali mukhopadhyay, you can overwrite previous state with sum of previous state and the new values inside the loop.
for example
T(i,j) = T(i,j)+new_value;
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!