I am summing matrix elements in different arrays. Say we have 2 arrays:

Price=num2cell(1:10);Coupon=num2cell(1:10);

Price is a cell composed of different matrices. The same for Coupon.

Now the size of the matrices inside "Price" and "Coupon" are not always equal. Of course if I run a code similar to this...

for i=1:10

Price{1,i}+ coupon{1,i};

end

...I get an error which what you would expect because the first matrix of "Price" and "Coupon" are of different size, ....

Now I would like to run an If statement to say: if matrix sizes of Price and Coupon are similar then sum them, if they are not equal then drop that extra elements (at the end) and just sum the first elements. How can I do that please?