Вы находитесь на странице: 1из 1

MIULLER

f=get(handles.edit1,'string');
x1=str2num(get(handles.edit2,'string'));
x2=str2num(get(handles.edit3,'string'));
x3=str2num(get(handles.edit4,'string'));
x=x1
y1=eval(f)
x=x2
y2=eval(f)
x=x3
y3=eval(f)
a=[x1.^2 x1 1;x2.^2 x2 1;x3.^2 x3 1]D
b=[y1;y2;y3]
xx=inv(a)*b
A=xx(1)
B=xx(2)
C=xx(3)
r1=(-B+sqrt(B.^2-4*A*C))/(2*A)
r2=(-B-sqrt(B.^2-4*A*C))/(2*A)
set(handles.edit5,'string',r1)
set(handles.edit6,'string',r2)

Вам также может понравиться