MATLAB: Can I assign a single value to multiple elements of a cell array without a loop

cell arrays

For example, I have an array that looks like
myArray =
[3] [] [3] []
I'd like to fill out the empty elements of myArray with zeros, but, obviously, the following doesn't work:
myArray{find(cellfun(@isempty,myArray))} = 0
Obviously, I could write a loop, but there has to be a better way!
Thanks for any suggestions!

Best Answer

You almost had the syntax right:
myArray(find(cellfun(@isempty,myArray))) = {0}
Or you can just use logical indexing and skip the find:
myArray(cellfun(@isempty,myArray)) = {0}