⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 nlsegui.m

📁 应用matlab解非线性薛定厄方程的问题
💻 M
📖 第 1 页 / 共 5 页
字号:
    while ~found && s<=tmp_n,
        if n==handles.Ploted_Data_Index_Display1(1,s),
            found=1;
        end
        s=s+1;
    end
    if found==1 && 2==tmp_n,
        handles.Ploted_Data_Index_Display1=[];
        guidata(hObject,handles);
    elseif found ==1,
        handles.Ploted_Data_Index_Display1=[handles.Ploted_Data_Index_Display1(1,1:s-2),handles.Ploted_Data_Index_Display1(1,s:tmp_n)];
        guidata(hObject,handles);
    end
    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==1 && 2==tmp_n,
        handles.Ploted_Data_Index_Display2=[];
        guidata(hObject,handles);
    elseif found ==1,
        handles.Ploted_Data_Index_Display2=[handles.Ploted_Data_Index_Display2(1,1:s-2),handles.Ploted_Data_Index_Display2(1,s:tmp_n)];
        guidata(hObject,handles);
    end
    handles.Signal_num = handles.Signal_num-1;
    guidata(hObject,handles);
    tmpStr=cat(2,handles.Loaded_Signal_List,handles.Empty,num2str(handles.Loaded_Signal_Ppty(:,1)),handles.Empty,num2str(handles.Loaded_Signal_Ppty(:,2)));
    set(handles.Loaded_Signals,'String',tmpStr,'Value',handles.Signal_num);
    set(handles.gRemove_IS,'Enable','on');
    set(handles.gIS_Edit,'Enable','on');
end
% --------------------------------------------------------------------
function gQuit_Callback(hObject, eventdata, handles)

delete(handles.figure1);


% --- Executes on button press in gRefreshDisplay1.
function gRefreshDisplay1_Callback(hObject, eventdata, handles)

if isempty(handles.Ploted_Data_Index_Display1),
    set(handles.gRefreshDisplay1,'Enable','off');
    axes(handles.Display1);
    cla;
    set(get(handles.Display1,'YLabel'),'String','');
    set(get(handles.Display1,'XLabel'),'String','');
    set(handles.Display1,'XTickLabel','','YTickLabel','');
    set(handles.gShow1,'Enable','off');
elseif handles.Ploted_Data_Index_Display1(1,1)==1,
    [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')
elseif handles.Ploted_Data_Index_Display1(1,1)==2,
    [tmp_m,tmp_n]=size(handles.Ploted_Data_Index_Display1);
    h=plot( fftshift(handles.Frequency),((1/handles.Samples_Num)*abs(fftshift(handles.Signal_Spectrum(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','Frequency (T_0^{-1})','FontSize',12,'FontName','Courier New','FontWeight','bold')
else
    [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')
end


% --- Executes on button press in gRefreshDisplay2.
function gRefreshDisplay2_Callback(hObject, eventdata, handles)

if isempty(handles.Ploted_Data_Index_Display2),
    set(handles.gRefreshDisplay2,'Enable','off');
    axes(handles.Display2);
    cla;
    set(get(handles.Display2,'YLabel'),'String','');
    set(get(handles.Display2,'XLabel'),'String','');
    set(handles.Display2,'XTickLabel','','YTickLabel','');
    set(handles.gShow2,'Enable','off');
elseif handles.Ploted_Data_Index_Display2(1,1)==1,
    [tmp_m,tmp_n]=size(handles.Ploted_Data_Index_Display2);
    h=plot( handles.Time,abs(handles.Signal(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','Time (T_0)','FontSize',12,'FontName','Courier New','FontWeight','bold')
elseif handles.Ploted_Data_Index_Display2(1,1)==2,
    [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')
else
    [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')
end


% --- Executes on button press in gShow1.
function gShow1_Callback(hObject, eventdata, handles)
if handles.Play_Index_Display1==1,
    n = get(handles.gLaunch_List,'Value');
    i = floor(get(handles.gShowframes,'Value'));
    m = sum(handles.Media_Ppty(:,2,n));
    figure(2)
    plot(handles.Time,abs(handles.Launch_Data_Signal(i,:,n)).^2);
    grid off
    axis on
    axis([-handles.Para_Mov(1,2)/2 handles.Para_Mov(1,2)/2 0 handles.Para_Mov(1,3)])
    ylabel('Intensity','FontSize',12,'FontName','Courier New','FontWeight','bold')
    xlabel('Time (T_0)','FontSize',12,'FontName','Courier New','FontWeight','bold')
elseif handles.Play_Index_Display1==2,
    n = get(handles.gLaunch_List,'Value');
    i = floor(get(handles.gShowframes,'Value'));
    m = sum(handles.Media_Ppty(:,2,n));
    figure(2)
    plot(fftshift(handles.Frequency),abs(fftshift(handles.Launch_Data_Spectrum(i,:,n))).^2);
    grid off
    axis on
    axis([-handles.Para_Mov(2,2)/2 handles.Para_Mov(2,2)/2 0 handles.Para_Mov(2,3)])
    ylabel('Intensity','FontSize',12,'FontName','Courier New','FontWeight','bold')
    xlabel('Frequency (T_0^{-1})','FontSize',12,'FontName','Courier New','FontWeight','bold')
else
    if isempty(handles.Ploted_Data_Index_Display1),
        errordlg('The Signal has been removed!','Error Dialog Box','modal');
        set(handles.gShow1,'Enable','off');
    elseif handles.Ploted_Data_Index_Display1(1,1)==1,
        figure(2);
        [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);
        xlabel('Time (T_0)','FontSize',12,'FontName','Courier New','FontWeight','bold')
        ylabel('Intensity','FontSize',12,'FontName','Courier New','FontWeight','bold')
    elseif handles.Ploted_Data_Index_Display1(1,1)==2,
        figure(2);
        [tmp_m,tmp_n]=size(handles.Ploted_Data_Index_Display1);
        h=plot( fftshift(handles.Frequency),((1/handles.Samples_Num)*abs(fftshift(handles.Signal_Spectrum(handles.Ploted_Data_Index_Display1(1,2:tmp_n),:)))).^2);
        xlabel('Frequency (T_0^{-1})','FontSize',12,'FontName','Courier New','FontWeight','bold')
        ylabel('Intensity','FontSize',12,'FontName','Courier New','FontWeight','bold')
    else
        figure(2);
        [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),:));
        xlabel('Time (T_0)','FontSize',12,'FontName','Courier New','FontWeight','bold')
        ylabel('Frequency Chirp','FontSize',12,'FontName','Courier New','FontWeight','bold')
    end
end

% --- Executes on button press in gShow2.
function gShow2_Callback(hObject, eventdata, handles)

if handles.Play_Index_Display2==1,
    n = get(handles.gLaunch_List,'Value');
    i = floor(get(handles.gShowframes,'Value'));
    m = sum(handles.Media_Ppty(:,2,n));
    figure(3)
    plot(handles.Time,abs(handles.Launch_Data_Signal(i,:,n)).^2);
    grid off
    axis on
    axis([-handles.Para_Mov(1,2)/2 handles.Para_Mov(1,2)/2 0 handles.Para_Mov(1,3)])
    ylabel('Intensity','FontSize',12,'FontName','Courier New','FontWeight','bold')
    xlabel('Time (T_0)','FontSize',12,'FontName','Courier New','FontWeight','bold')
elseif handles.Play_Index_Display2==2,
    n = get(handles.gLaunch_List,'Value');
    i = floor(get(handles.gShowframe2,'Value'));
    m = sum(handles.Media_Ppty(:,2,n));
    figure(3)
    plot(fftshift(handles.Frequency),abs(fftshift(handles.Launch_Data_Spectrum(i,:,n))).^2);
    grid off
    axis on
    axis([-handles.Para_Mov(2,2)/2 handles.Para_Mov(2,2)/2 0 handles.Para_Mov(2,3)])
    ylabel('Intensity','FontSize',12,'FontName','Courier New','FontWeight','bold')
    xlabel('Frequency (T_0^{-1})','FontSize',12,'FontName','Courier New','FontWeight','bold')
else
    if isempty(handles.Ploted_Data_Index_Display2),
        errordlg('The Signal has been removed!','Error Dialog Box','modal');
        set(handles.gShow2,'Enable','off');
    elseif handles.Ploted_Data_Index_Display2(1,1)==1,
        figure(3);
        [tmp_m,tmp_n]=size(handles.Ploted_Data_Index_Display2);
        h=plot( handles.Time,abs(handles.Signal(handles.Ploted_Data_Index_Display2(1,2:tmp_n),:)).^2);
        xlabel('Time (T_0)','FontSize',12,'FontName','Courier New','FontWeight','bold')
        ylabel('Intensity','FontSize',12,'FontName','Courier New','FontWeight','bold')
    elseif handles.Ploted_Data_Index_Display2(1,1)==2,
        figure(3);
        [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);
        xlabel('Frequency (T_0^{-1})','FontSize',12,'FontName','Courier New','FontWeight','bold')
        ylabel('Intensity','FontSize',12,'FontName','Courier New','FontWeight','bold')
    else
        figure(3);
        [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),:));
        xlabel('Time (T_0)','FontSize',12,'FontName','Courier New','FontWeight','bold')
        ylabel('Frequency Chirp','FontSize',12,'FontName','Courier New','FontWeight','bold')
    end
end

% --- Executes during object creation, after setting all properties.
function gLaunch_List_CreateFcn(hObject, eventdata, handles)
% hObject    handle to gLaunch_List (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: listbox controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc
    set(hObject,'BackgroundColor','white');
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end


% --- Executes on selection change in gLaunch_List.
function gLaunch_List_Callback(hObject, eventdata, handles)

% --- Executes on button press in gL_Remove.
function gL_Remove_Callback(hObject, eventdata, handles)


% --- Executes on button press in gL_Edit.
function gL_Edit_Callback(hObject, eventdata, handles)
n=get(handles.gLaunch_List,'Value');
[selection,ok] = listdlg('ListString',handles.Loaded_Signal_List,'SelectionMode','single','InitialValue', handles.Input_Signal_Index(n,1),'Name','Choose Input Signal','ListSize',[150 100]);
if ~isempty(selection),
    handles.Input_Signal_Index(n,1) = selection;
end
if handles.Special_Medium_Index(1,n)==0,
    for j=1:4,
        prompt{1} = 'Length';
        prompt{2} = 'Number of Points Along the Length';
        prompt{3} = 'Second order GVD';
        prompt{4} = 'Third order GVD';
        prompt{5} = 'Nonlinear Coefficient';
        prompt{6} = 'Absorption Coefficient';
        prompt{7} = 'Self-steepening Parameter';
        prompt{8} = 'Raman Scattering Parameter';
        default_ans ={num2str(handles.Media_Ppty(j,1,n)),num2str(handles.Media_Ppty(j,2,n)),num2str(handles.Media_Ppty(j,3,n)),num2str(handles.Media_Ppty(j,4,n)),num2str(handles.Media_Ppty(j,5,n)),num2str(handles.Media_Ppty(j,6,n)),num2str(handles.Media_Ppty(j,7,n)),num2str(handles.Media_Ppty(j,8,n))}; 
        title = ['Medium Parameters For Medium ',num2str(j)];
        answer = inputdlg(prompt,title,1,default_ans);
        if ~isempty(answer),
            handles.Media_Ppty(j,1,n)=str2num(answer{1});
            handles.Media_Ppty(j,2,n)=str2num(answer{2});
            handles.Media_Ppty(j,3,n)=str2num(answer{3});
            handles.Media_Ppty(j,4,n)=str2num(answer{4});
            handles.Media_Ppty(j,5,n)=str2num(answer{5});
            handles.Media_Ppty(j,6,n)=str2num(answer{6});
            handles.Media_Ppty(j,7,n)=str2num(answer{7});
            handles.Media_Ppty(j,8,n)=str2num(answer{8});
        end
    end
else
    
    for j=1:4,
        prompt{1} = 'Length';
        

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -