📄 nlsegui.m
字号:
set(handles.gT2,'String','');
handles.Play_Index_Display2 = 0;
guidata(hObject,handles);
handles.show_side_by_side(1,1) = 0;
guidata(hObject,handles);
else
s=2;found=0;
[tmp_m,tmp_n]=size(handles.Ploted_Data_Index_Display2);
while ~found && s<=tmp_n,
if n==handles.Ploted_Data_Index_Display2(1,s),
found=1;
end
s=s+1;
end
if found==0,
handles.Ploted_Data_Index_Display2 = [handles.Ploted_Data_Index_Display2,n];
guidata(hObject,handles);
end
[tmp_m,tmp_n]=size(handles.Ploted_Data_Index_Display2);
h=plot( fftshift(handles.Frequency),((1/handles.Samples_Num)*abs(fftshift(handles.Signal_Spectrum(handles.Ploted_Data_Index_Display2(1,2:tmp_n),:)))).^2,'Parent',handles.Display2);
set(get(handles.Display2,'YLabel'),'String','Intensity','FontSize',12,'FontName','Courier New','FontWeight','bold')
set(get(handles.Display2,'XLabel'),'String','Frequency (T_0^{-1})','FontSize',12,'FontName','Courier New','FontWeight','bold')
set(handles.gRefreshDisplay2,'Enable','on','Visible','on');
set(handles.gShowframe2,'Visible','off','Value',1)
set(handles.gShow2,'Enable','on');
set(handles.gT2,'String','');
handles.Play_Index_Display2 = 0;
guidata(hObject,handles);
handles.show_side_by_side(1,1) = 0;
guidata(hObject,handles);
end
else
handles.Ploted_Data_Index_Display2 = [2,n];
guidata(hObject,handles);
h=plot( fftshift(handles.Frequency),((1/handles.Samples_Num)*abs(fftshift(handles.Signal_Spectrum(n,:)))).^2,'Parent',handles.Display2);
set(get(handles.Display2,'YLabel'),'String','Intensity','FontSize',12,'FontName','Courier New','FontWeight','bold')
set(get(handles.Display2,'XLabel'),'String','Frequency (T_0^{-1})','FontSize',12,'FontName','Courier New','FontWeight','bold')
set(handles.gRefreshDisplay2,'Enable','on','Visible','on');
set(handles.gShowframe2,'Visible','off','Value',1)
set(handles.gShow2,'Enable','on');
set(handles.gT2,'String','');
handles.Play_Index_Display2 = 0;
guidata(hObject,handles);
handles.show_side_by_side(1,1) = 0;
guidata(hObject,handles);
end
% --------------------------------------------------------------------
function gSFC_Callback(hObject, eventdata, handles)
% --------------------------------------------------------------------
function gSFC_Display1_Callback(hObject, eventdata, handles)
% shows the frequency chirp of the signal
n=get(handles.Loaded_Signals,'Value');
if n==0,
errordlg('No Signal selected!','Error Dialog Box','modal');
elseif ~isempty(handles.Ploted_Data_Index_Display1),
button = questdlg('Do you want to Erase the existing plot?','','Yes','No','Yes');
if strcmp(button,'Yes'),
handles.Ploted_Data_Index_Display1 = [3,n];
guidata(hObject,handles);
h=plot(handles.Time,handles.Frequency_Chirp(n,:),'Parent',handles.Display1);
set(get(handles.Display1,'YLabel'),'String','Frequency Chirp','FontSize',12,'FontName','Courier New','FontWeight','bold')
set(get(handles.Display1,'XLabel'),'String','Time (T_0)','FontSize',12,'FontName','Courier New','FontWeight','bold')
set(handles.gRefreshDisplay1,'Enable','on','Visible','on');
set(handles.gShowframes,'Visible','off','Value',1)
set(handles.gShow1,'Enable','on');
set(handles.gT1,'String','');
handles.Play_Index_Display1 = 0;
guidata(hObject,handles);
handles.show_side_by_side(1,1) = 0;
guidata(hObject,handles);
else
s=2;found=0;
[tmp_m,tmp_n]=size(handles.Ploted_Data_Index_Display1);
while ~found && s<=tmp_n,
if n==handles.Ploted_Data_Index_Display1(1,s),
found=1;
end
s=s+1;
end
if found==0,
handles.Ploted_Data_Index_Display1 = [handles.Ploted_Data_Index_Display1,n];
guidata(hObject,handles);
end
[tmp_m,tmp_n]=size(handles.Ploted_Data_Index_Display1);
h=plot( handles.Time,handles.Frequency_Chirp(handles.Ploted_Data_Index_Display1(1,2:tmp_n),:),'Parent',handles.Display1);
set(get(handles.Display1,'YLabel'),'String','Frequency Chirp','FontSize',12,'FontName','Courier New','FontWeight','bold')
set(get(handles.Display1,'XLabel'),'String','Time (T_0)','FontSize',12,'FontName','Courier New','FontWeight','bold')
set(handles.gRefreshDisplay1,'Enable','on','Visible','on');
set(handles.gShowframes,'Visible','off','Value',1)
set(handles.gShow1,'Enable','on');
set(handles.gT1,'String','');
handles.Play_Index_Display1 = 0;
guidata(hObject,handles);
handles.show_side_by_side(1,1) = 0;
guidata(hObject,handles);
end
else
handles.Ploted_Data_Index_Display1 = [3,n];
guidata(hObject,handles);
h=plot( handles.Time,handles.Frequency_Chirp(n,:),'Parent',handles.Display1);
set(get(handles.Display1,'YLabel'),'String','Frequency Chirp','FontSize',12,'FontName','Courier New','FontWeight','bold')
set(get(handles.Display1,'XLabel'),'String','Time (T_0)','FontSize',12,'FontName','Courier New','FontWeight','bold')
set(handles.gRefreshDisplay1,'Enable','on','Visible','on');
set(handles.gShowframes,'Visible','off','Value',1)
set(handles.gShow1,'Enable','on');
set(handles.gT1,'String','');
handles.Play_Index_Display1 = 0;
guidata(hObject,handles);
handles.show_side_by_side(1,1) = 0;
guidata(hObject,handles);
end
% --------------------------------------------------------------------
function gSFC_Display2_Callback(hObject, eventdata, handles)
n=get(handles.Loaded_Signals,'Value');
if n==0,
errordlg('No Signal selected!','Error Dialog Box','modal');
elseif ~isempty(handles.Ploted_Data_Index_Display2),
button = questdlg('Do you want to Erase the existing plot?','','Yes','No','Yes');
if strcmp(button,'Yes'),
handles.Ploted_Data_Index_Display2 = [3,n];
guidata(hObject,handles);
h=plot( handles.Time,handles.Frequency_Chirp(n,:),'Parent',handles.Display2);
set(get(handles.Display2,'YLabel'),'String','Frequency Chirp','FontSize',12,'FontName','Courier New','FontWeight','bold')
set(get(handles.Display2,'XLabel'),'String','Time (T_0)','FontSize',12,'FontName','Courier New','FontWeight','bold')
set(handles.gRefreshDisplay1,'Enable','on','Visible','on');
set(handles.gShowframe2,'Visible','off','Value',1)
set(handles.gShow2,'Enable','on');
set(handles.gT2,'String','');
handles.Play_Index_Display2 = 0;
guidata(hObject,handles);
handles.show_side_by_side(1,1) = 0;
guidata(hObject,handles);
else
s=2;found=0;
[tmp_m,tmp_n]=size(handles.Ploted_Data_Index_Display2);
while ~found && s<=tmp_n,
if n==handles.Ploted_Data_Index_Display2(1,s),
found=1;
end
s=s+1;
end
if found==0,
handles.Ploted_Data_Index_Display2 = [handles.Ploted_Data_Index_Display2,n];
guidata(hObject,handles);
end
[tmp_m,tmp_n]=size(handles.Ploted_Data_Index_Display2);
h=plot( handles.Time,handles.Frequency_Chirp(handles.Ploted_Data_Index_Display2(1,2:tmp_n),:),'Parent',handles.Display2);
set(get(handles.Display2,'YLabel'),'String','Frequency Chirp','FontSize',12,'FontName','Courier New','FontWeight','bold')
set(get(handles.Display2,'XLabel'),'String','Time (T_0)','FontSize',12,'FontName','Courier New','FontWeight','bold')
set(handles.gRefreshDisplay2,'Enable','on','Visible','on');
set(handles.gShowframe2,'Visible','off','Value',1)
set(handles.gShow2,'Enable','on');
set(handles.gT2,'String','')
handles.Play_Index_Display2 = 0;
guidata(hObject,handles);
handles.show_side_by_side(1,1) = 0;
guidata(hObject,handles);
end
else
handles.Ploted_Data_Index_Display2 = [3,n];
guidata(hObject,handles);
h=plot( handles.Time,handles.Frequency_Chirp(n,:),'Parent',handles.Display2);
set(get(handles.Display2,'YLabel'),'String','Frequency Chirp','FontSize',12,'FontName','Courier New','FontWeight','bold')
set(get(handles.Display2,'XLabel'),'String','Time (T_0)','FontSize',12,'FontName','Courier New','FontWeight','bold')
set(handles.gRefreshDisplay2,'Enable','on','Visible','on');
set(handles.gShowframe2,'Visible','off','Value',1);
set(handles.gShow2,'Enable','on');
set(handles.gT2,'String','')
handles.Play_Index_Display2 = 0;
guidata(hObject,handles);
handles.show_side_by_side(1,1) = 0;
guidata(hObject,handles);
end
% --------------------------------------------------------------------
function gSSig_Callback(hObject, eventdata, handles)
% --------------------------------------------------------------------
function gSSig_Display1_Callback(hObject, eventdata, handles)
n=get(handles.Loaded_Signals,'Value');
if n==0,
errordlg('No Signal selected!','Error Dialog Box','modal');
elseif ~isempty(handles.Ploted_Data_Index_Display1),
button = questdlg('Do you want to Erase the existing plot?','','Yes','No','Yes');
if strcmp(button,'Yes'),
handles.Ploted_Data_Index_Display1 = [1,n];
guidata(hObject,handles);
h=plot( handles.Time,abs(handles.Signal(n,:)).^2,'Parent',handles.Display1);
set(get(handles.Display1,'YLabel'),'String','Intensity','FontSize',12,'FontName','Courier New','FontWeight','bold')
set(get(handles.Display1,'XLabel'),'String','Time (T_0)','FontSize',12,'FontName','Courier New','FontWeight','bold')
set(handles.gRefreshDisplay1,'Enable','on','Visible','on');
set(handles.gShowframes,'Visible','off','Value',1);
set(handles.gShow1,'Enable','on');
set(handles.gT1,'String','');
handles.Play_Index_Display1 = 0;
guidata(hObject,handles);
handles.show_side_by_side(1,1) = 0;
guidata(hObject,handles);
else
s=2;found=0;
[tmp_m,tmp_n]=size(handles.Ploted_Data_Index_Display1);
while ~found && s<=tmp_n,
if n==handles.Ploted_Data_Index_Display1(1,s),
found=1;
end
s=s+1;
end
if found==0,
handles.Ploted_Data_Index_Display1 = [handles.Ploted_Data_Index_Display1,n];
guidata(hObject,handles);
end
[tmp_m,tmp_n]=size(handles.Ploted_Data_Index_Display1);
h=plot( handles.Time,abs(handles.Signal(handles.Ploted_Data_Index_Display1(1,2:tmp_n),:)).^2,'Parent',handles.Display1);
set(get(handles.Display1,'YLabel'),'String','Intensity','FontSize',12,'FontName','Courier New','FontWeight','bold')
set(get(handles.Display1,'XLabel'),'String','Time (T_0)','FontSize',12,'FontName','Courier New','FontWeight','bold')
set(handles.gRefreshDisplay1,'Enable','on','Visible','on');
set(handles.gShowframes,'Visible','off','Value',1);
set(handles.gShow1,'Enable','on');
set(handles.gT1,'String','');
handles.Play_Index_Display1 = 0;
guidata(hObject,handles);
handles.show_side_by_side(1,1) = 0;
guidata(hObject,handles);
end
else
handles.Ploted_Data_Index_Display1 = [1,n];
guidata(hObject,handles);
h=plot( handles.Time,abs(handles.Signal(n,:)).^2,'Parent',handles.Display1);
set(get(handles.Display1,'YLabel'),'String','Intensity','FontSize',12,'FontName','Courier New','FontWeight','bold')
set(get(handles.Display1,'XLabel'),'String','Time (T_0)','FontSize',12,'FontName','Courier New','FontWeight','bold')
set(handles.gRefreshDisplay1,'Enable','on','Visible','on');
set(handles.gShowframes,'Visible','off','Value',1);
set(handles.gShow1,'Enable','on');
set(handles.gT1,'String','');
handles.Play_Index_Display1 = 0;
guidata(hObject,handles);
handles.show_side_by_side(1,1) = 0;
guidata(hObject,handles);
end
% --------------------------------------------------------------------
function gSSig_Display2_Callback(hObject, eventdata, handles)
n=get(handles.Loaded_Signals,'Value');
if n==0,
errordlg('No Signal selected!','Error Dialog Box','modal');
elseif ~isempty(handles.Ploted_Data_Index_Display2),
button = questdlg('Do you want to Erase the existing plot?','','Yes','No','Yes');
if strcmp(button,'Yes'),
handles.Ploted_Data_Index_Display2 = [1,n];
guidata(hObject,handles);
h=plot( handles.Time,abs(handles.Signal(n,:)).^2,'Parent',handles.Display2);
set(get(handles.Display2,'YLabel'),'String','Intensity','FontSize',12,'FontName','Courier New','FontWeight','bold')
set(get(handles.Display2,'XLabel'),'String','Time (T_0)','FontSize',12,'FontName','Courier New','FontWeight','bold')
set(handles.gRefreshDisplay2,'Enable','on','Visible','on');
set(handles.gShowframe2,'Visible','off','Value',1);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -