[S_B, S_W] = calculate_scatters(data, flag_modified_s_b = 0, penalty=0) calculate_scatters(pieces, flag_modified_s_b = 0, penalty=0) Input: data: structure with the following: .X: dataset with rows as observations and columns as features; .classes: column vector with corresponding classes (0-based) flag_modified_s_b: if 1, S_B will be calculated in an alternative way which is class terms will not be weighet by class sample size, which will cause all classes to have equal importance. P: penalty matrix to be added to S_W Outputs: - S_W: "within-class scatter matrix" - S_B: "inter-class scatter matrix"