【正文】
ring39。)) returns contents of edit1 as a double% Executes during object creation, after setting all properties.function edit1_CreateF(hObject, eventdata, handles)% hObject handle to edit1 (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。amp。 isequal(get(hObject,39。BackgroundColor39。), get(0,39。defaultUicontrolBackgroundColor39。)) set(hObject,39。BackgroundColor39。,39。white39。)。end% Executes on button press in pushbuttonExit.function pushbuttonExit_Callback(hObject, eventdata, handles)ss=questdlg(39。確認退出?39。,39。退出信息窗口!39。,39。繼續(xù)仿真!39。,39。退出仿真!39。,39。退出仿真!39。)。switch ss case 39。退出仿真!39。 delete()。end% hObject handle to pushbuttonExit (see GCBO)% eventdata reserved to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)四、使用指南和實例仿真進入MATLAB軟件,打開并運行程序。初始界面:對ω2的值進行修改,修改為實例中的50*2*pi=,點擊開始仿真按鈕,得到仿真結(jié)果:點擊退出仿真按鈕,進入退出界面:點擊繼續(xù)仿真按鈕,則回到程序界面;點擊退出仿真按鈕,則退出程序。五、結(jié)語由四,通過MATLAB仿真得到的結(jié)果與實際情況符合。通過該次作業(yè),我了解并初步掌握了MATLAB的語言編寫和guide界面的使用,鞏固并加深了對課上知識的理解,受益良