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

    function gui_hist_2D; 
% GUI_HIST_2D   Two-dimensional histogram.

% last modified 02.12.04

global TS GSD_GLOBALS

str=TS.name;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% check the input
[selection_1,ok] = listdlg('PromptString','Select fist data axes:',...
                'SelectionMode','single','ListString',str);
if ~ok
    return
end
[selection_2,ok] = listdlg('PromptString','Select second data axes:',...
                'SelectionMode','single','ListString',str);
if ~ok
    return
end

prompt = {'Enter number of bins per axes:'};
dlg_title = 'Enter number of bins';
num_lines= 1;
def     = {num2str(ceil(length(TS.data(:,selection_1))^0.5))};
answer  = inputdlg(prompt,dlg_title,num_lines,def);
if isempty(answer)
    return
end
k=str2num(answer{1});

hist_2D(TS.data(:,selection_1),TS.data(:,selection_2),k);
set(xlabel(TS.name{selection_1}),'interpreter','none'), set(ylabel(TS.name{selection_2}),'interpreter','none');