First option: how about merging the numeric arrays together? Doing this would make these kind of calculations much easier! Read about vectorization to know why. So assuming that for whatever reason your data absolutely cannot be converted to simple numeric arrays, then why not use arrayfun and cellfun to get the job done. This is a working example of how you could go about doing this: >> A = {{[0,1],[1,1],[0,0]},{[1,1],[1,0],[0,0]},{[1,1],[0,1],[0,1]}};
>> fun = @(C) arrayfun(@(c,n)c{1}*2^(7-n), C(1:2),1:2, 'UniformOutput',false);
>> out = cellfun(fun, A, 'UniformOutput',false);
I simplified your arrays down so that A has three cells, and each cell contains one sub-cellarray which contains three numeric vectors of size 1x2. The required function is defined by c{1}*2^(7-n), and it is preformed only on the contents of the first two cells of each of the sub-cellarray due to the indexing C(1:2),1:2.
But the best solution is to convert your data to simple numeric arrays.
Best Answer