Hello,
I have a 1×4 cell array, each cell contains a 1000×8 zeros array:
A = arrayfun(@(~) zeros(1000,8),(1:4),'un',0);
Now I want to assign every same row (definded by a background counter) with a new array same length, e.g B = [1 1 1 1 1 1 1 1]
The following loop discribes it quite well…
counter = randi(1000) % any row
for i = 1:4 A{i}(counter,:) = B;end
I was just wondering if there is a way doing it with cellfun?
Best Answer