As some improve,I complete this function almost perfect work for me
function multicolmn(mat,col)
if nargin<2
col=fix(floor(sqrt(numel(mat))));
end
if isnumeric(mat)
disp(sprintf([repmat('%d\t',1,col) '\n'], mat))
elseif iscell(mat)
n=max(cellfun(@length,mat))
disp(sprintf([repmat(sprintf('%%-%ds\t',n),1,col) '\n'],mat{:}))
end
It will show the input like a square shape as much as possible.Such as
>> multicolmn(1:17)
1 2 3 4
5 6 7 8
9 10 11 12
13 14 15 16
17
Or
clear;
h=figure;
t=set(h,'pointer');
>> multicolmn(t)
arrow ibeam crosshair watch
topl topr botl botr
circle cross fleur custom
left top right bottom
hand
Of course,you can specify the colum you want to show
>> multicolmn(t,3)
arrow ibeam crosshair
watch topl topr
botl botr circle
cross fleur custom
left top right
bottom hand