www.gusucode.com > Matlab动力系统和时间序列分析工具箱 > Matlab动力系统和时间序列分析工具箱/lab432/gui/gui_data_histogram.m

    function gui_data_histogram;
% GUI_DATA_HISTOGRAM plot histogram 

% last modified 2.02.05

global TS GSD_GLOBALS

str=TS.name;
% if isa(str,'char')
%     str={str};
% end
[selection,ok] = listdlg('PromptString','Select data:',...
                'SelectionMode','multiple','ListString',str);
   
if ok
    N=length(selection);
    Fignumbs=floor(N/3);
    Additaxes=mod(N,3);
    tempHandleA=[];
    tempHandleF=[];
    for i=1:Fignumbs
        tempHandleF(i)=figure('Units','characters',...
            'Name',['Data Histogram: ' num2str(selection(3*(i-1)+1)) ',' num2str(selection(3*(i-1)+2)) ',' num2str(selection(3*(i-1)+3)) ' (' str{selection(3*(i-1)+1)} ', ' str{selection(3*(i-1)+2)} ', ' str{selection(3*(i-1)+3)} ')'],...
            'NumberTitle','off','color',[1 1 1]);
        for j=1:3
            tempHandleA=[tempHandleA subplot(3,1,j)];
            hist_1D(TS.data(:,selection(3*(i-1)+j)));
            set(ylabel(str{selection(3*(i-1)+j)}),'Interpreter','none');
            drawnow;
        end
    end
    if Additaxes==1
        tempHandleF(end+1)=figure('Units','characters',...
            'Name',['Data Histogram: ' num2str(selection(3*Fignumbs+1))  ' (' str{selection(3*Fignumbs+1)} ' )'],...
            'NumberTitle','off','color',[1 1 1]);
    end
    if Additaxes==2
        tempHandleF(end+1)=figure('Units','characters',...
            'Name',['Data Histogram: ' num2str(selection(3*Fignumbs+1)) ',' num2str(selection(3*Fignumbs+2)) ' (' str{selection(3*Fignumbs+1)} ', ' str{selection(3*Fignumbs+2)} ')'],...
            'NumberTitle','off','color',[1 1 1]);
    end
    for i=1:Additaxes
        tempHandleA=[tempHandleA subplot(3,1,i)];
        hist_1D(TS.data(:,selection(3*Fignumbs+i)));
        set(ylabel(str{selection(3*Fignumbs+i)}),'Interpreter','none');
        drawnow;
    end
    set(tempHandleA,'fontsize',8);
    GSD_GLOBALS.fig_handles=[GSD_GLOBALS.fig_handles tempHandleF];
end