multiply correspond element in cell arrays

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

 Accepted 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.

More Answers (1)

Categories

Asked:

mhm
on 21 Jan 2016

Commented:

mhm
on 21 Jan 2016

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!