function tsPartSeriesGet(Y)

fhandle=figure;
b =  uimenu('Parent',fhandle, ...
           'Callback','getTSPart_work2',...
           'Label','Взять часть ряда');

plot(Y);
n=length(Y);
uicontrol('Style','text','Units','normalized','Position',[0.01 0.03 0.2 0.05],'String','Початок фрагменту:');
uicontrol('Style','edit','Units','normalized','Position',[0.2 0.03 0.1 0.05],'String',' 1 ');
uicontrol('Style','text','Units','normalized','Position',[0.3 0.03 0.2 0.05],'String','Кінець фрагменту:');
uicontrol('Style','edit','Units','normalized','Position',[0.5 0.03 0.1 0.05],'String',num2str(n));
uicontrol('Style','text','Units','normalized','Position',[0.6 0.03 0.1 0.05],'String','Крок:');
uicontrol('Style','edit','Units','normalized','Position',[0.7 0.03 0.1 0.05],'String','1');
uicontrol('Style','pushbutton','Units','normalized','Position',[0.8 0.03 0.15 0.05],'String','Вирізати','Callback',@guiCutSave_Callback);


function guiCutSave_Callback(hObject, eventdata, handles);
par=get(hObject,'Parent');
childs=get(par,'Children');
nbegin=str2double(get(childs(length(childs)-3),'String'));
nend=str2double(get(childs(length(childs)-5),'String'));
step=str2double(get(childs(length(childs)-7),'String'));
childs_plot=get(gca,'Children');
YY=get(childs_plot(1),'YData');
YY_cuted=YY(nbegin:step:nend);
global SERIES
global SERIESINDEX
global SERIESTYPE
global SERIESSTAT
if (size(YY_cuted,2)>size(YY_cuted,1))
    RES=YY_cuted;
else
    RES=transpose(YY_cuted);
end

    global HHANDLES;
    handles=HHANDLES;
    index=get(handles.listbox1,'Value');
    
    SERIESINDEX=SERIESINDEX+1;

    SERIES{SERIESINDEX}=RES;
    SERIESSTAT{SERIESINDEX}=getStat(RES);
    SERIESSTAT{SERIESINDEX}.fileName=SERIESSTAT{index}.fileName;
    SERIESTYPE{SERIESINDEX}=[char(SERIESTYPE{index}) ';ABS'];
    saveInfo(handles,SERIESSTAT{SERIESINDEX});
    CD=get(handles.listbox1,'String');
    [CDm,CDn]=size(CD);
    CD(CDm+1,:)='Сutted  ';
    set(handles.listbox1,'String',CD);
    set(handles.listbox1,'Value',SERIESINDEX);


function guiCutSelectPoints(hObject, eventdata, handles);
