MATLAB: How i can sum the lines of a matrix sum matrix p.x 1 4 5 2 1 … 3 1 9 3 2 … = 4 5 14 5 3 but with out knowing the number of lines or the number of rows thanks Best Answer if a is a x-by-y matrixb=sum(a) will give you a new b matrix which will be 1-by-y matrix which will have the summation of each column. Related SolutionsMATLAB: Sum I am a little confused, do you mean like this:Y = reshape(1:18,6,3) % A manageable dimension.Y_1 = sum(Y,2)So in your case it would beY_1 = sum(Y,2).';..Or do you mean, more like this:Y = 1:18Y_1 = sum(reshape(Y,3,6))So in your case it would beY_1 = sum(reshape(Y,320,467)) MATLAB: Sum Matrix excluding certain values y = sum(MatrixA(MatrixA > 3)) Related QuestionHow to sum n lines of a matrix to another matrixI have a mxn binary logical matrix . How to sum onesHow to sum column of matrixHow to sum two rows at a time in matrixHow to sum specific matrix elements
Best Answer