My array contains a string in the first row
how can I sum the array from the 2nd row to the Nth/1442th row (as in my example) disregarding the negative signs present in the column?
for example, my code for an array called data2
is:
S = sum(data2(2,15):data2(1442,15));
so sum all of the elements from row 2 to row 1442 in column 15. This doesn't work but it also does not have anything to deal with the absolute value of whatever row its checking
data is from a .csv:
You should do something like this:
The
abs
function will find the absolute value of each value in the array (i.e. disregard the negative sign).data(2:1442,15)
will grab rows 2-1442 of the 15th column, as you wanted.EDIT: apparently
data
is a cell array, so you could do the following, I think: