【正文】
y=sqrt(1i/L*exp(1i*k*L))*sum(exp(1i*k/2/L*(x_+x).^2).*u)*step_length。 end % function Untitled_1_Callback(hObject, eventdata, handles) % hObject handle to Untitled_1 (see GCBO) 激光原理課程設(shè)計(jì) 15 % eventdata reserved to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) function y=QU(x,u) global steps L k a x_=linspace(a,a,steps)。 Z_P=sqrt((interp1(x,angle_u0,X)).^2+(interp1(x,angle_u0,Y)).^2)。 axes() surf(X,Y,Z_A) axis([a a a a 0 ]) angle_u0=angle(u0)/pi*180。 end abs_u0=abs(u0)/abs(u0(steps/2))。 u_=ones(1,steps)。 x=linspace(a,a,steps)。 k=2*pi/lamda。String39。))。 a=str2num(get(,39。String39。))。 end % Executes on button press in pushbutton3. function pushbutton3_Callback(hObject, eventdata, handles) % hObject handle to pushbutton3 (see GCBO) % eventdata reserved to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) global steps L k a lamda=str2num(get(,39。 激光原理課程設(shè)計(jì) 14 angle_u0=angle_u0angle_u0(steps/2)。 for m=1:N for mm=1:steps u0(mm)=QU(x(mm),u_)。 x=linspace(a,a,steps)。 k=2*pi/lamda。String39。))。 a=str2num(get(,39。String39。))。 end % Executes on button press in pushbutton2. function pushbutton2_Callback(hObject, eventdata, handles) % hObject handle to pushbutton2 (see GCBO) % eventdata reserved to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) global steps L k a lamda=str2num(get(,39。white39。BackgroundColor39。defaultUicontrolBackgroundColor39。BackgroundColor39。amp。String39。String39。)。,39。)) set(hObject,39。), get(0,39。 isequal(get(hObject,39。)) returns contents of area as a double % Executes during object creation, after setting all properties. function area_CreateF(hObject, eventdata, handles) % hObject handle to area (see GCBO) % eventdata reserved to be defined in a future version of MATLAB % handles empty handles not created until after all CreateFs called % Hint: edit controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc amp。) returns contents of area as text % str2double(get(hObject,39。 end function area_Callback(hObject, eventdata, handles) % hObject handle to area (see GCBO) % eventdata reserved to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,39。white39。BackgroundColor39。defaultUicontrolBackgroundColor39。BackgroundColor39。amp。String39。String39。)。,39。)) set(hObject,39。), get(0,39。 isequal(get(hObject,39。)) returns contents of wavelength as a double % Executes during object creation, after setting all properties. function wavelength_CreateF(hObject, eventdata, handles) % hObject handle to wavelength (see GCBO) % eventdata reserved to be defined in a future version of MATLAB % handles empty handles not created until after all CreateFs called % Hint: edit controls usually have a white background on Windows. %