I have an 80x1
cell array, where each cell element has a different size. I want to round the second and third columns of each cell to the closest integer, divided by 4. I have no idea hoe to do it. I have tried cellfun so far but it didint work. See below for my code:
clear all;
clc;
for k = 1 : 80
A{k} = 1 : k;
end
for k = 1 : 80
B{k} = 1 : k;
end
for k = 1 : 80
newb{k} = 1 : k;
end
for k = 1 : 80
r5{k} = 1 : k;
% code to create Mcell i.e cell array 400 x 1
Mcell = mat2cell(a5n,repmat(174,400,1),3)
%each image size x and y
for ii=1:80 [A{ii,1},B{ii,1}] =find(Mcell{ii,1} == 280);
% ii
%find sizes 13 and their locations in Mcell(ii,1)
newb{ii,1}=Mcell{ii,1}(A{ii,1},:);
%ii matrix with size and locations x y. i.e size=13 x=4 y=50
end
cellfun(@round,newbii,1}(:,2:3)/4)*4);
newb{ii,1}=Mcell{ii,1}(A{ii,1},:);