FAL Find total number of figures and run the command for each figure as defined by varargin Find all figure handles, whose visibility are on fal('reline,reline') a = fal fal('randplotl;randplotc;setlinw(1)') fal reline fal setmrkw(2) fal legend('reza') fal('rezas = rand(3,1);legnum(rezas,5,''hasi''''s '', ''reza'')')