您好,欢迎访问三七文档
当前位置:首页 > 行业资料 > 冶金工业 > MATLAB常见错误(GUI篇)
MATLAB 102GUIcurrentdirectory 153GUIh0bjecthandles 164handles 175Matlab 195-1GUItext 225-2editcallback 226MATLAB 227 238Matlabuitable 249MatlabGUIMatlab 2510Matlab*.exe 2811matlabGUIexe 3112gui 3313GUIsimulink 3413-1axes 3514waitbarwaitbar'' 3615matlabFFT 3816figurex-y 4017GUI 4218Matlab 4519editboxpushbutton 4619-1GUIeditbox 4620GUIexcel 4721popupmenuVALUE 4922 49 5023pushbuttoncallback 5024GUIaxessubplotaxes 5125GUI 5326 5327GUI 5528-1 5728-2GUI 6029GUItimer 6030waitbar 6131 6232 6333Matlabgcf 6334-1matlabexcel 6534-2excel 6635MatlabGUI 68360 6937Matlablistbox? 7038matlabGUI 7239GUI 7340matlab 7641MATLABGUI-[MATLAB] 8442MATLABGUI-[MATLAB] 8643MATLABGUI-[MATLAB] 8744Matlabaxes 8845MatlabGUI 9146GUI 9747axes 11348GUI 11449guisimulink 11450 11751matlab 11952GUIaxesY 12153GUI 12154GUIsimulink 12255 13456GUIaxesaxes 13557 13658 13759axes 14060GUIIE 14161guirs232 14162Matlabguiexcel 14263matlab 14564matlabtabdlg 14865MatlabRGB 14866 14967MATLAB 15068GUI 15369MatlabGRID 156 15772 15873 16074Matlabcsvread 16175 16276 16278listbox 16379NaN 16480z=x^2-y^2 16481ode45 16582Matlabpic 16583exp(-x)=cos(x),=10e-6 16684 16685 16785-1 1698661012345678910 16987textread.txt 16988 17089matlab 17290 1749101234567820X20 17492 17593 17594MATLABGUI 17795Matlab 18096workspaceGUI 18097matlab'' 18198 18199 185100matlab 185101xyz 186102cellarray 186103 188104figure 189105 189106 191107 193108edit 194109MATLABplot 195110MATlabz 203111GUIhandles 203112Matlab 204113guideGUI 206114Matlabfigure 208115matlab 209116 209117Matlab 210118imshowfigure 211119 211120Matlabtxt 212 213122figurelegend 214123GUI 215124Matlaby=1\xy 218125GUI'' 219126 2191GUI--GUIMGUIDEGUIMGUIMGUICALLBACKScallbacksMcallback^_^function[avg,med]=newstats(u)%Primaryfunction%NEWSTATSFindmeanandmedianwithinternalfunctions.n=length(u);avg=mean(u,n);med=median(u,n);functiona=mean(v,n)%Subfunction%Calculateaverage.a=sum(v)/n;functionm=median(v,n)%Subfunction%Calculatemedian.w=sort(v);ifrem(n,2)==1m=w((n+1)/2);elsem=(w(n/2)+w(n/2+1))/2;end functionnestatsfunctionmeanmedianMfunctionvarargout=setfire(varargin)setfiremfunctioncreatFcncallbackMavg=mean(u,n);med=median(u,n);callbackMSharingDatawiththeHandlesStructurehandlesGUIMhandleshandleshandlesGUI=X;callbackguidata(hObject,handles)~X1=handles.current_data;bGUIGUIABall_choicesmy_menuTAGall_choices=get(handles.my_menu,'String')current_choice=all_choices{get(handles.my_menu,'Value')};current_choicehandles.handles..getsetM-FileOpeningfunctionGUIOutputfunction^_^CallbackscallbackM-FilefunctionhObjecthandlesGUIguidata(hObject,handles);;POpnningFunctionhandles.tagOpnningopenning''functionmy_gui_OpeningFcn(hObject,eventdata,handles,varargin)eventdatamatlabvararginvarargin-------------my_gui('Position',[71.844.974.819.7])%GUIGUIGUIPositionGUImy_gui('','')vararginvararging{1}=''vararging{2}=''GUIOutputFunction=my_gui_OutputFcn(hObject,eventdata,handles)%Getdefaultcommandlineoutputfromhandlesstructurevarargout{1}=handles.output;vararoutcallbackvararoutcallbackvararouthandles.outputguidata(hObject,handles);outputvarargout{1}=handles.outputvararoutoutputoutputFcnvarargout{2}=handles.guidata(hObject,handles)deleteoutputfcnoutputvararginuiwait(handles.figure1);uiresumeCallbackscallbackcallbacktagfunctionprint_button_Callback(hObject,eventdata,handles)2GUIcurrentdirectoryfigmtxttxtpushbutton???Undefinedfunctionormethod'fenbianlv1'forinputargumentsoftype'struct'.Errorin==@(hObject,eventdata)fenbianlv1('pushbutton2_Callback',hObject,eventdata,guidata(hObject))???ErrorwhileevaluatinguicontrolCallbackpushbuttonpushbuttonpushbuttonpushbuttonpushbuttoncallbackpushbuttonpushbuttoncallbackpushbuttoncallbackpushbutton1pushbutton2cd(dataRoute)matlabcurrentdirectoryoldpath=cd;cd(oldpath);fenbianlv1.3GUIh0bjecthandlesGUIPop_upMenus:function=pushbutton1_Callback(hObject,eventdata,handles):Val=get(h0bject,'Value')Val=get(handles.pushbutton1,'Value');h0bjecthandles?MATLABGUIGUIdataapplicationdataGUIdataGUIfigurehandlesfigurehandlesfigurehandleshandleshandlesguidata=axes('tag','tag1');delete(handles.axes1);handleshandles=axes1:0.027figurehandles.axesget(handles.axes,'tag')???Referencetonon-existentfield'axes'.delete(handles.axes1)handles.axes1handlesaxes1getsethandles.axes1,handles.axeshandlesaxesinvalidhandleobjectget(handles.axes,'tag')???Referencetonon-existentfield'axes'.22matlabhelp%CreatefiguretouseasGUIinyourmainfunctionorasubfunctionfigure_handle=figure();%createstructureofhandlesmyhandles=guihandles(figure_handle);%AddsomeadditionaldataasanewfieldcallednumberOfErrorsmyhandl
本文标题:MATLAB常见错误(GUI篇)
链接地址:https://www.777doc.com/doc-5951647 .html