I am trying to calculate sum of certain maximum elements of arrays. When some of these variables are not available in the program (due to if statement), then the maximum value of element of these variable array comes out to be 0X0 double (as I have by default defined the variable as a cell array of zeros).
The problem I am facing is an error "Unable to perform assignment because the indices on the left side are not compatible with the size of the right side."
I think the error is due to the multiplication part of two variables on the right side of equation i.e. - 0X0 double and one scalar. The other (left) side of equation (sum) is supposed to produce the scalar value.
How to handle this and get the scalar output on left side by ignoring these "absent" variables value (assigned 0 X0 double and a scalar)???
Can anybody help with this small issue and guide me on this, please?