How to do sum?
2 views (last 30 days)
I have data of 1891*4. In first row I have degree from 0 to 60 which has repetation of degree and I want to add all the same degree values which are in column 3 and add for column 4too. How can I do it?
if you load the data we are getting shc_06 and shc_12. Please find the attachment of code but I dont know how to calculate of same number degree in column1 have to added in column 3 and 4 respectively. So i will get 60*1 as output because the in column one we are having range from 0 to 60.
del_cl_06 = shc06(:,3);
del_sl_06 = shc06(:,4);
del_cl_12 = shc12(:,3);
del_sl_12 = shc12(:,4);
Monisha Nalluru on 14 Aug 2020
From my understanding, you want to first group the data based on temperature and then add the values of values of 3rd and 4th column based on grouping.
In this case you may use findgroups in order to group the data and to perform operation on grouped data you can use splitapply
You may use below code as example
G = findgroups(shc12(:,1));
Hope this gives an idea!