gui分段函数.docx

上传人:b****0 文档编号:8967453 上传时间:2023-05-16 格式:DOCX 页数:21 大小:16.36KB
下载 相关 举报
gui分段函数.docx_第1页
第1页 / 共21页
gui分段函数.docx_第2页
第2页 / 共21页
gui分段函数.docx_第3页
第3页 / 共21页
gui分段函数.docx_第4页
第4页 / 共21页
gui分段函数.docx_第5页
第5页 / 共21页
gui分段函数.docx_第6页
第6页 / 共21页
gui分段函数.docx_第7页
第7页 / 共21页
gui分段函数.docx_第8页
第8页 / 共21页
gui分段函数.docx_第9页
第9页 / 共21页
gui分段函数.docx_第10页
第10页 / 共21页
gui分段函数.docx_第11页
第11页 / 共21页
gui分段函数.docx_第12页
第12页 / 共21页
gui分段函数.docx_第13页
第13页 / 共21页
gui分段函数.docx_第14页
第14页 / 共21页
gui分段函数.docx_第15页
第15页 / 共21页
gui分段函数.docx_第16页
第16页 / 共21页
gui分段函数.docx_第17页
第17页 / 共21页
gui分段函数.docx_第18页
第18页 / 共21页
gui分段函数.docx_第19页
第19页 / 共21页
gui分段函数.docx_第20页
第20页 / 共21页
亲,该文档总共21页,到这儿已超出免费预览范围,如果喜欢就下载吧!
下载资源
资源描述

gui分段函数.docx

《gui分段函数.docx》由会员分享,可在线阅读,更多相关《gui分段函数.docx(21页珍藏版)》请在冰点文库上搜索。

gui分段函数.docx

gui分段函数

functionvarargout=workout(varargin)

%WORKOUTM-fileforworkout.fig

%WORKOUT,byitself,createsanewWORKOUTorraisestheexisting

%singleton*.

%

%H=WORKOUTreturnsthehandletoanewWORKOUTorthehandleto

%theexistingsingleton*.

%

%WORKOUT('CALLBACK',hObject,eventData,handles,...)callsthelocal

%functionnamedCALLBACKinWORKOUT.Mwiththegiveninputarguments.

%

%WORKOUT('Property','Value',...)createsanewWORKOUTorraisesthe

%existingsingleton*.Startingfromtheleft,propertyvaluepairsare

%appliedtotheGUIbeforeworkout_OpeningFcngetscalled.An

%unrecognizedpropertynameorinvalidvaluemakespropertyapplication

%stop.Allinputsarepassedtoworkout_OpeningFcnviavarargin.

%

%*SeeGUIOptionsonGUIDE'sToolsmenu.Choose"GUIallowsonlyone

%instancetorun(singleton)".

%

%Seealso:

GUIDE,GUIDATA,GUIHANDLES

%Edittheabovetexttomodifytheresponsetohelpworkout

%LastModifiedbyGUIDEv2.528-Aug-201520:

29:

52

%Begininitializationcode-DONOTEDIT

gui_Singleton=1;

gui_State=struct('gui_Name',mfilename,...

'gui_Singleton',gui_Singleton,...

'gui_OpeningFcn',@workout_OpeningFcn,...

'gui_OutputFcn',@workout_OutputFcn,...

'gui_LayoutFcn',[],...

'gui_Callback',[]);

ifnargin&&ischar(varargin{1})

gui_State.gui_Callback=str2func(varargin{1});

end

ifnargout

[varargout{1:

nargout}]=gui_mainfcn(gui_State,varargin{:

});

else

gui_mainfcn(gui_State,varargin{:

});

end

%Endinitializationcode-DONOTEDIT

%---Executesjustbeforeworkoutismadevisible.

functionworkout_OpeningFcn(hObject,eventdata,handles,varargin)

%Thisfunctionhasnooutputargs,seeOutputFcn.

%hObjecthandletofigure

%eventdatareserved-tobedefinedinafutureversionofMATLAB

%handlesstructurewithhandlesanduserdata(seeGUIDATA)

%varargincommandlineargumentstoworkout(seeVARARGIN)

%Choosedefaultcommandlineoutputforworkout

handles.output=hObject;

%Updatehandlesstructure

guidata(hObject,handles);

%UIWAITmakesworkoutwaitforuserresponse(seeUIRESUME)

%uiwait(handles.figure1);

%---Outputsfromthisfunctionarereturnedtothecommandline.

functionvarargout=workout_OutputFcn(hObject,eventdata,handles)

%varargoutcellarrayforreturningoutputargs(seeVARARGOUT);

%hObjecthandletofigure

%eventdatareserved-tobedefinedinafutureversionofMATLAB

%handlesstructurewithhandlesanduserdata(seeGUIDATA)

%Getdefaultcommandlineoutputfromhandlesstructure

varargout{1}=handles.output;

functioninput_Callback(hObject,eventdata,handles)

%hObjecthandletoinput(seeGCBO)

%eventdatareserved-tobedefinedinafutureversionofMATLAB

%handlesstructurewithhandlesanduserdata(seeGUIDATA)

input=str2num(get(hObject,'String'));

if(isempty(input))

set(hObject,'String','')

end

guidata(hObject,handles);

%Hints:

get(hObject,'String')returnscontentsofinputastext

%str2double(get(hObject,'String'))returnscontentsofinputasadouble

%---Executesduringobjectcreation,aftersettingallproperties.

functioninput_CreateFcn(hObject,eventdata,handles)

%hObjecthandletoinput(seeGCBO)

%eventdatareserved-tobedefinedinafutureversionofMATLAB

%handlesempty-handlesnotcreateduntilafterallCreateFcnscalled

%Hint:

editcontrolsusuallyhaveawhitebackgroundonWindows.

%SeeISPCandCOMPUTER.

ifispc&&isequal(get(hObject,'BackgroundColor'),get(0,'defaultUicontrolBackgroundColor'))

set(hObject,'BackgroundColor','white');

end

%---Executesonbuttonpressinv.

functionv_Callback(hObject,eventdata,handles)

%hObjecthandletov(seeGCBO)

%eventdatareserved-tobedefinedinafutureversionofMATLAB

%handlesstructurewithhandlesanduserdata(seeGUIDATA)

a=get(handles.input,'String');

x1=get(handles.input1,'String');

y1=get(handles.input2,'String');

x2=get(handles.input3,'String');

y2=get(handles.input4,'String');

x3=get(handles.input5,'String');

y3=get(handles.input6,'String');

x4=get(handles.input7,'String');

y4=get(handles.input8,'String');

x5=get(handles.input9,'String');

y5=get(handles.input10,'String');

x6=get(handles.input11,'String');

y6=get(handles.input12,'String');

u1=str2num(x3);

u2=str2num(y3);

u3=str2num(x4);

u4=str2num(y4);

u5=str2num(x5);

u6=str2num(y5);

u7=str2num(x6);

u8=str2num(y6);

q=str2num(a);

w=str2num(x1);

e=str2num(y1);

r=str2num(x2);

t=str2num(y2);

x=[wu1u3u5u7r];

y=[eu2u4u6u8t];

m=diff(y)./diff(x);

n=interp1(x,y,q);

h=num2str(n);

xielv=num2str(m);

set(handles.slope,'String',xielv);

set(handles.answer,'String',h);

guidata(hObject,handles);

axes(handles.axes1);

plot(x,y,'r')

set(gca,'xtick',[0:

150:

2500]);

set(gca,'xlim',[02000]);

holdon

fori=1:

length(x)

plot(x(i),y(i),'*')

str=['('num2str(x(i))','num2str(y(i))')'];

text(x(i),y(i),str)

end

%set(handles.axes,'position',[0,0,1000,1000]);

functioninput1_Callback(hObject,eventdata,handles)

%hObjecthandletoinput1(seeGCBO)

%eventdatareserved-tobedefinedinafutureversionofMATLAB

%handlesstructurewithhandlesanduserdata(seeGUIDATA)

input1=str2num(get(hObject,'String'));

if(isempty(input1))

set(hObject,'String','')

end

guidata(hObject,handles);

%Hints:

get(hObject,'String')returnscontentsofinput1astext

%str2double(get(hObject,'String'))returnscontentsofinput1asadouble

%---Executesduringobjectcreation,aftersettingallproperties.

functioninput1_CreateFcn(hObject,eventdata,handles)

%hObjecthandletoinput1(seeGCBO)

%eventdatareserved-tobedefinedinafutureversionofMATLAB

%handlesempty-handlesnotcreateduntilafterallCreateFcnscalled

%Hint:

editcontrolsusuallyhaveawhitebackgroundonWindows.

%SeeISPCandCOMPUTER.

ifispc&&isequal(get(hObject,'BackgroundColor'),get(0,'defaultUicontrolBackgroundColor'))

set(hObject,'BackgroundColor','white');

end

functioninput2_Callback(hObject,eventdata,handles)

%hObjecthandletoinput2(seeGCBO)

%eventdatareserved-tobedefinedinafutureversionofMATLAB

%handlesstructurewithhandlesanduserdata(seeGUIDATA)

input2=str2num(get(hObject,'String'));

if(isempty(input2))

set(hObject,'String','')

end

guidata(hObject,handles);

%Hints:

get(hObject,'String')returnscontentsofinput2astext

%str2double(get(hObject,'String'))returnscontentsofinput2asadouble

%---Executesduringobjectcreation,aftersettingallproperties.

functioninput2_CreateFcn(hObject,eventdata,handles)

%hObjecthandletoinput2(seeGCBO)

%eventdatareserved-tobedefinedinafutureversionofMATLAB

%handlesempty-handlesnotcreateduntilafterallCreateFcnscalled

%Hint:

editcontrolsusuallyhaveawhitebackgroundonWindows.

%SeeISPCandCOMPUTER.

ifispc&&isequal(get(hObject,'BackgroundColor'),get(0,'defaultUicontrolBackgroundColor'))

set(hObject,'BackgroundColor','white');

end

functioninput3_Callback(hObject,eventdata,handles)

%hObjecthandletoinput3(seeGCBO)

%eventdatareserved-tobedefinedinafutureversionofMATLAB

%handlesstructurewithhandlesanduserdata(seeGUIDATA)

input3=str2num(get(hObject,'String'));

if(isempty(input3))

set(hObject,'String','')

end

guidata(hObject,handles);

%Hints:

get(hObject,'String')returnscontentsofinput3astext

%str2double(get(hObject,'String'))returnscontentsofinput3asadouble

%---Executesduringobjectcreation,aftersettingallproperties.

functioninput3_CreateFcn(hObject,eventdata,handles)

%hObjecthandletoinput3(seeGCBO)

%eventdatareserved-tobedefinedinafutureversionofMATLAB

%handlesempty-handlesnotcreateduntilafterallCreateFcnscalled

%Hint:

editcontrolsusuallyhaveawhitebackgroundonWindows.

%SeeISPCandCOMPUTER.

ifispc&&isequal(get(hObject,'BackgroundColor'),get(0,'defaultUicontrolBackgroundColor'))

set(hObject,'BackgroundColor','white');

end

functioninput4_Callback(hObject,eventdata,handles)

%hObjecthandletoinput4(seeGCBO)

%eventdatareserved-tobedefinedinafutureversionofMATLAB

%handlesstructurewithhandlesanduserdata(seeGUIDATA)

input4=str2num(get(hObject,'String'));

if(isempty(input4))

set(hObject,'String','')

end

guidata(hObject,handles);

%Hints:

get(hObject,'String')returnscontentsofinput4astext

%str2double(get(hObject,'String'))returnscontentsofinput4asadouble

%---Executesduringobjectcreation,aftersettingallproperties.

functioninput4_CreateFcn(hObject,eventdata,handles)

%hObjecthandletoinput4(seeGCBO)

%eventdatareserved-tobedefinedinafutureversionofMATLAB

%handlesempty-handlesnotcreateduntilafterallCreateFcnscalled

%Hint:

editcontrolsusuallyhaveawhitebackgroundonWindows.

%SeeISPCandCOMPUTER.

ifispc&&isequal(get(hObject,'BackgroundColor'),get(0,'defaultUicontrolBackgroundColor'))

set(hObject,'BackgroundColor','white');

end

functioninput5_Callback(hObject,eventdata,handles)

%hObjecthandletoinput5(seeGCBO)

%eventdatareserved-tobedefinedinafutureversionofMATLAB

%handlesstructurewithhandlesanduserdata(seeGUIDATA)

%Hints:

get(hObject,'String')returnscontentsofinput5astext

%str2double(get(hObject,'String'))returnscontentsofinput5asadouble

input5=str2num(get(hObject,'String'));

if(isempty(input5))

set(hObject,'String','')

end

guidata(hObject,handles);

%---Executesduringobjectcreation,aftersettingallproperties.

functioninput5_CreateFcn(hObject,

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > IT计算机 > 电脑基础知识

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2