MATLAB: Adding a constant to every term in a cell array

cell arrayMATLAB

I'm trying to add a constant to every term in the cell array. For example A = {[1 2 3] [4 5 6] [7 8 9]} and I want to add 5 to each term to create a cell array B= { [6 7 8] [ 9 10 11] [ 12 13 14]} Thanks!

Best Answer

A = {[1 2 3] [4 5 6] [7 8 9]}
out=cellfun(@(x) x+5,A,'un',0)