MATLAB: Multiply correspond element in cell arrays

multiply correspond element

Hi everybody
I have 2 cell arrays a and b, how could I multiplying together their correspond elements.
a =
Columns 1 through 4
[41x1 double] [319x1 double] [54x1 double] [355x1 double]
Column 5
[400x1 double]
b =
Columns 1 through 4
[41x1 double] [319x1 double] [54x1 double] [355x1 double]
Column 5
[400x1 double]
Thanks in advance

Best Answer

Use cellfun:
c = cellfun(@times, a, b, 'UniformOutput', false) %times is function name of .*
This will only work if all elements of the cell array are the same size AND the cell array are the same size.