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

    function gui_extract_time;
% EXTRACT_TIME extract time series from data set and define it
% as observation time
%
% last modified 28.08.07

global TS

if length(TS.data(1,:))==1
    helpdlg('You have only 1 time series and you can''t define it as time','Operation cancelled');
    return
end

str=TS.name;
[selection,ok] = listdlg('PromptString','Select data to extract as time:',...
                'SelectionMode','single','ListString',str);
if ok 
    time=TS.data(:,selection);
    TS.data(:,selection)=[];
    TS.name(selection)=[];
    TS.time=time;
end