samedi 31 décembre 2016

How to make conditional calculations in a table using loop mechanisms? (Matlab)

I have the following table ('ABC'): enter image description here


Goal: For each date, create 2 new variables (e.g. 'LSum' and 'USum'). 'LSum' should calculate the sum of all cell values across the column universe (4-281), but only with those values whose header is in the cell array of ABC.L, for that specific date. In the same fashion, 'USum' should calculate the sum of all cell values across the columns, but only with those values whose header is in the cell array of ABC.U, for that specific date.


Thanks in advance for your help, especially for the looping through date and the cell arrays of 'L' and 'U' at the same time.

Aucun commentaire:

Enregistrer un commentaire