Upload
javierr-fc
View
233
Download
18
Embed Size (px)
DESCRIPTION
Interporlacion
Citation preview
function pushbutton1_Callback(hObject, eventdata, handles)x=str2num(get(handles.edit1,'string'));y=str2num(get(handles.edit2,'string'));a=str2num(get(handles.edit3,'string'));w=length(x);L=zeros(w,w);for k=1:w V=1; for j=1:w if k~=j V=conv(V,poly(x(j)))./(x(k)-x(j)); end end L(k,:)=V;endC=y*L;Pa=polyval(C,a);L='Coeficientes';L=strvcat(L,num2str(C));set(handles.listbox1,'string',L);set(handles.edit4,'string',Pa);%Graficay1=polyval(C,x);plot(x,y1,'squarer','MarkerFaceColor','m','MarkerSize',8);hold onx1=x(1):0.1:x(w);y=polyval(C,x1);plot(x1,y)grid onhold off
PROGRAMACION
function pushbutton2_Callback(hObject, eventdata, handles)set(handles.edit1,'string',' ');set(handles.edit2,'string',' ');set(handles.edit3,'string',' ');set(handles.edit4,'string',' ');set(handles.listbox1,'string',' ');plot(0,0)
function pushbutton3_Callback(hObject, eventdata, handles)close