From: joseph Frank on
cell2mat(Samplein2(:,145)-cell2mat(Samplein2(:,116)
is giving me an error that Matrix dimenssions must agree

the reason is that many entries in the columns are Nans and when I use cellmat the 145 column ends up with 397 observations whereas 116 ends up with 401 observations.

is there a way to subtract the two columns and receive the result in a double format?
From: Walter Roberson on
joseph Frank wrote:
> cell2mat(Samplein2(:,145)-cell2mat(Samplein2(:,116)
> is giving me an error that Matrix dimenssions must agree
>
> the reason is that many entries in the columns are Nans and when I use
> cellmat the 145 column ends up with 397 observations whereas 116 ends up
> with 401 observations.
>
> is there a way to subtract the two columns and receive the result in a
> double format?

arrayfun(@(K) Samplein2{K,145} - SampleIn2{K,116}, 1:size(Samplein2,1))