MATLAB: @findall in an arrayfun

arrayfunfindall

Hi,
I'm having trouble using findall as an arrayfun. In AppDesigner, I'd like to find all objects whose 'Tag' has 'img' in it – I have lots of uiimages, img_1, img_2… img_25, and then run a function on all these uiimages?
I've tried the following:
arrayfun(@findall,0, 'Tag', a);
where a = is a cell array of strcat of 'img_' + num2str(n);
a = cell(25,1);
for i = 1:25
a{i} = strcat('img_',num2str(i));
end
Thanks!

Best Answer

The cellfun function is likely a better option.
Experiment with something like this:
Out = cellfun(@(x)findall(0,'Tag','img'), a, 'Unif',0);
It will likely be necessary to experiment with that to get it to work with your images.
I cannot test this with your images, so I am posting it as UNTESTED CODE. (If it or some version of it does not work in your application, I will delete my Answer.)