Suppose I have a cell array with 3 elements; the first and third cells are matrices, while the second is empty:
>> P
P =
[3x8 double] [] [3x8 double]
I can fill in the second matrix by interpolating for every individual element in the matrix, but surely there must be a way to do this in one shot?
EDIT: An average would certainly work for P. But suppose I have something like
>> Q
Q = [3x8 double] [3x8 double] [3x8 double] [] [] [3x8 double]
So given my four known matrices, I could use a fancier interpolation (like spline) to fill in the missing matrices.
You can perform all the interpolation in a single function call to INTERP1, but it requires setting the data into the desired shape, then back once done:
Just keep in mind that vectorization sometimes comes at the cost of readability…