|
|
[ÇóÖú]
GUIÉè¼ÆÎÊÌ⡪¡ªÄâºÏ¸ø¶¨ËĸöµãµÄÄâºÏÇúÏß
¸÷λ´óÏÀÇë°ï棡ÎÒ´òËãÉè¼ÆÒ»¸ögui½çÃæ£¬ÊäÈëËĸöµãµÄ×ø±ê£¬È»ºóÄâºÏÇúÏߣ¬Êä³öÇúÏßͼÐΣ¬Ò»ÏÂÊÇÎÒÒѾ×öµÄ¹¤×÷£¬µ«ÊÇÔËÐв»³ö½á¹û£º
Ð޸ĵijÌÐò²¿·ÖÈçÏ£º
function pushbutton1_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
t1=str2double(get(handles.t1_input,'string'))%t1t2t3t4v1v2v3v4Êǵã¶ÔÓ¦µÄ×ø±ê
t2=str2double(get(handles.t2_input,'string'))
t3=str2double(get(handles.t3_input,'string'))
t4=str2double(get(handles.t4_input,'string'))
v1=str2double(get(handles.v1_input,'string'))
v2=str2double(get(handles.v2_input,'string'))
v3=str2double(get(handles.v3_input,'string'))
v4=str2double(get(handles.v4_input,'string'))
T=[t1 t2 t3 t4];%Ñù±¾µãºá×ø±ê(ʱ¼ä)µÄÏòÁ¿
V=[v1 v2 v3 v4];%Ñù±¾µã×Ý×ø±ê(ËÙ¶È)µÄÏòÁ¿
v=polyfit(T,V,4);%ËÙ¶ÈÇúÏß¶àÏîʽÄâºÏ
axes(handles.tu_axes)%×ø±êͼµÄtagΪtu
plot(T,V,'r*');%»Ñù±¾µã
hold on;%±£³Öµ±Ç°»æÍ¼´°¿Ú£¬¼ÌÐøÔÚ´Ë»æÍ¼´°¿ÚÉÏ»ÄâºÏÇúÏß
t=(0:0.0001:0.028);%È·¶¨×Ô±äÁ¿Öµx
y2=polyval(v,t);%polyvalº¯ÊýÇó¶ÔÓ¦tµÄ¶àÏîʽµÄvÖµ£¬
plot(t,y2);
grid on;%×ø±êͼÉÏ»·Ö¸ñÏß
![]()
½çÃæµÄ½ØÍ¼ |
|