Hi!

How could I sum a value in a row of a Matrix? Imagine I have:

(0,0,0;0,0,0;0,0,0;0,0,0) and I would like to have (0,0,0;3,3,3;0,0,0;0,0,0)

How could I get this result?

Thank you

Skip to content# MATLAB: Sum a value in a matrix

matrixsum

Hi!

How could I sum a value in a row of a Matrix? Imagine I have:

(0,0,0;0,0,0;0,0,0;0,0,0) and I would like to have (0,0,0;3,3,3;0,0,0;0,0,0)

How could I get this result?

Thank you

## Best Answer