.


:




:

































 

 

 

 


-




:

X = [0 1 2 3 4 5 6 7 8];

Y = [0 1 4 9 16 25 36 49 64];

X_inp =[5.5 8.5];

flag=0;

, -, , :

X_out=[5.5 8.5];

Y_out=[ 30.25 72.25];

.

8.1.

8.1 -

 

 

GUI

:

X = [0 1 2 3 4 5 6 7 8];

Y = [0 1 4 9 16 25 36 49 64];

X_inp =[5.5 8.5];

flag=0;

, GUI, , :

X_out=[5.5 8.5];

Y_out=[ 30.25 72.25];

.

8.2.

 

8.2 GUI


 

- inter.sci, Scilab, : . GUI . . , .



1. .. SCILAB./ .. . .: -, 2004. 209 .

2. , . : . ./ . .: , 1969. 368 .

3. , . : . ./. , . .:, 1999. 548 .


inter ()

 

//

//: .., .., -204

//: 1.0, 2012

// inter():

// X ;

// Y X;

// flag ;

// X_inp , .

// inter():

// _out , .

// Y_out .

 

 

function [X_out, Y_out]=inter(X, Y, X_inp, flag)

X_out=X_inp;

n=size(X);

N=n(2);// X

m=size(X_inp);

M=m(2);// X_inp

Y_out=zeros(1, M);//

//

if (flag==0) then //

for i=1:M

Y_out(1, i)=0;

for j=1:N

L1=1;

L2=1;

for k=1:j-1

L1=L1*((X_inp(i)-X(k))/(X(j)-X(k)));

end

for k=j+1:N

L2=L2*((X_inp(i)-X(k))/(X(j)-X(k)));

end

Y_out(1, i)=Y_out(1, i)+L1*L2*Y(j);

end

end

else //

D=N-1;

// d

for i=1:D

d(i,1)=Y(i+1)-Y(i);

end

for i=2:D

for j=1:D-i+1

d(j,i)=d(j+1, i-1)-d(j, i-1);

end

end

//

for i=1:M

Y_out(1, i)=Y(1);

for ii=1:D

k(i, ii)=1;

for jj=1:ii

k(i, ii)=k(i, ii)*(X_inp(i)-X(jj));

end

Y_out(1, i)=Y_out(1, i)+(d(1, ii)*k(i, ii)/(factorial(ii)*((X(2)-X(1))^ii)));

end

end

end

endfunction

gui()

 

clear; clc; x=0; xinp=0; y=0; x0=0; n=0; h=0; i=1; yout=0; j0=1; j1=1; j2=1; j3=1;

// Create a figure

f = figure("figure_name", "",...

"Position",[50 50 900 400],...

"BackgroundColor",[1.0 1.0 1.0],...

"Tag", "uicontrols_demo_figure");

// Remove Scilab 'standard' menus

delmenu(f.figure_id, gettext("&File"));

delmenu(f.figure_id, gettext("&Tools"));

delmenu(f.figure_id, gettext("&Edit"));

delmenu(f.figure_id, gettext("&?"));

// Disable graphics toolbar

toolbar(f.figure_id, "off");

// Adjust figure size after toolbar removing

//f.position = [50 50 300 260];

function getf(a)

//

if a==1 then winopen('help.pdf'); end

if a==2 then fname=uigetfile(["*.txt"]); set(edit_frame_title_80, 'string', fname); end

// X, Y

endfunction

function about_pr()

messagebox([':' '' ' 1.0.0' ': ., .'], ' ');

endfunction

function close_uicontrols_demo()

delete(findobj("Tag", "uicontrols_demo_figure"));

endfunction

function exit_scilab()

msg = gettext("Do you really want to quit Scilab?");

answ = messagebox(msg, gettext("Quit Scilab"), "quextion", [gettext("Yes") gettext("No")], "modal");

if answ==1 then

exit;

end

endfunction

//

appli_menu = uimenu("Parent", f, "Label", "");

open_menu = uimenu("Parent", appli_menu, "Label", " ", "callback", "");

save_menu = uimenu("Parent", appli_menu, "Label", " ", "callback", "");

close_menu = uimenu("Parent", appli_menu, "Label", gettext("Exit figure"), "callback", "close_uicontrols_demo()");

quit_menu = uimenu("Parent", appli_menu, "Label", gettext("Quit Scilab"), "callback", "exit_scilab()");

help_menu = uimenu("Parent", f, "Label", "");

helpbox_menu = uimenu("Parent", help_menu, "Label", "", "callback", "getf(1)");

about_menu = uimenu("Parent", help_menu, "Label", " ", "callback", "about_pr()");

//

//

edit_frame_1 = uicontrol(f, "Position", [10 325 320 70],...

"Style", "frame",...

"BackgroundColor", [1.0 1.0 1.0]);

edit_frame_title_1 = uicontrol(f, "Position", [10 395 320 20],...

"Style", "text",...

"String", " :",...

"BackgroundColor", [1 1 1], "Relief", "ridge", "HorizontalAlignment", "center");

//

//

radio_lag=uicontrol(f, 'style','radiobutton','string',...

' ',"BackgroundColor", [1.0 1.0 1.0], 'value',1,'position',...

[20,360,300,20], 'tag', 'lag', "callback", "gui_lag()");

//

radio_new=uicontrol(f, 'style','radiobutton','string',...

' ',"BackgroundColor", [1.0 1.0 1.0], 'value',0,'position',...

[20,340,300,20], 'tag', 'new', "callback", "gui_new()");

//

edit_frame_title_10 = uicontrol(f, "Position", [10 305 320 20],...

"Style", "text",...

"String", " :",...

"BackgroundColor", [1.0 1.0 1.0], "Relief", "ridge", "HorizontalAlignment", "center");

edit_frame_11 = uicontrol(f, "Position", [10 235 320 70],...

"Style", "frame",...

"BackgroundColor", [1.0 1.0 1.0]);

//

radio_kb=uicontrol(f,'style','radiobutton','string',...

' ',"BackgroundColor", [1.0 1.0 1.0], 'value',1,'position',...

[20,267,300,20], "tag", "rkb", "callback", "enter_kb()");

//

radio_lf=uicontrol(f,'style','radiobutton','string',...

' ',"BackgroundColor", [1.0 1.0 1.0], 'value',0,'position',...

[20,247,300,20], "tag", "rlf", "callback", "enter_lf()");

//

edit_frame_title_20 = uicontrol(f, "Position", edit_frame_title_1.position+[490 0 0 0],...

"Style", "text",...

"String", ":",...

"BackgroundColor", [1 1 1], "Relief", "ridge", "HorizontalAlignment", "center");

//

//edit_frame_21 = uicontrol(f, "Position", [355 107 520 285],...

// "Style", "frame",...

// "BackgroundColor", [1.0 1.0 1.0]);

//

edit_frame_title_30 = uicontrol(f, "Position", [355 85 300 20],...

"Style", "text",...

"String", ":",...

"BackgroundColor", [1 1 1],"Relief", "ridge", "HorizontalAlignment", "center");

edit_frame_title_31 = uicontrol(f, "Position", [670 85 20 20],...

"Style", "text",...

"String", "1:",...

"BackgroundColor", [1 1 1], "tag", "text30");

edit_frame_title_32 = uicontrol(f, "Position", [690 85 25 20],...

"Style", "text",...

"String", "=",...

"BackgroundColor", [1 1 1], "Relief", "ridge", "HorizontalAlignment", "center");

edit_frame_title_33 = uicontrol(f, "Position", [714 85 60 20],...

"Style", "text",...

"String", "",...

"BackgroundColor", [1 1 1], "Relief", "ridge", "HorizontalAlignment", "left");

edit_frame_title_34 = uicontrol(f, "Position", [791 85 25 20],...

"Style", "text",...

"String", "=",...

"BackgroundColor", [1 1 1], "Relief", "ridge", "HorizontalAlignment", "center");

edit_frame_title_35 = uicontrol(f, "Position", [815 85 60 20],...

"Style", "text",...

"String", "",...

"BackgroundColor", [1 1 1], "Relief", "ridge", "HorizontalAlignment", "left");

edit_frame_title_36 = uicontrol(f, "Position", [355 60 300 20],...

"Style", "text",...

"String", " :",...

"BackgroundColor", [1 1 1], "Relief", "ridge", "HorizontalAlignment", "center");

theslider_30 = uicontrol(f, "Position", [670 60 205 20],...

"Style", "slider",...

"Min", 1,...

"Max", 50,...

"Value", 0,...

"SliderStep", [1 10],...

"Tag", "slider30",...

"Callback", "slider_update(1, j0, j1, j2, j3, x, y, xinp);", "Relief", "ridge");

edit_frame_title_37 = uicontrol(f, "Position", [355 35 450 20],...

"Style", "text",...

"String", " ",...

"BackgroundColor", [1 1 1], "Relief", "ridge", "HorizontalAlignment", "left");

disp_button_30 = uicontrol(f, "Position", [817 35 62 21],...

"Style", "pushbutton", "BackgroundColor", [0.95 0.95 0.95],...

"FontSize", 11,...

"String", "",...

"callback", "getf()");

//

edit_frame_0 = uicontrol(f, "Position", [10 75 320 160],...

"Style", "frame",...

"BackgroundColor", [1.0 1.0 1.0]);

// ""

disp_button_0 = uicontrol(f, "Position", [65 40 200 25],...

"Style", "pushbutton", "BackgroundColor", [0.95 0.95 0.95],...

"FontSize", 11,...

"String", "",...

"callback", "yout=inter1(x, y, xinp, i)");

// " "

edit_frame_title_40 = uicontrol(f, "Position", [10 155 320 20],...

"Style", "text",...

"String", " ",...

"BackgroundColor", [1 1 1], "Relief", "ridge", "HorizontalAlignment", "center");

//

edit_frame_title_50 = uicontrol(f, "Position", [20 115 15 20],...

"Style", "text",...

"String", "1:",...

"BackgroundColor", [1.0 1.0 1.0], "HorizontalAlignment", "center", "Tag", "text70");

// X_inp

edit_frame_title_50 = uicontrol(f, "Position", [35 115 25 20],...

"Style", "text",...

"String", "=",...

"BackgroundColor", [1.0 1.0 1.0], "Relief", "ridge", "HorizontalAlignment", "center");

x_out_edit = uicontrol(f, "Position", [60 115 60 20],...

"Style", "edit",...

"FontSize", 11,...

"String", "1",...

"BackgroundColor", [0.95 0.95 0.95],...

"Tag", "x_out");

// Y_out

edit_frame_title_60 = uicontrol(f, "Position", [130 115 25 20],...

"Style", "text",...

"String", "y=",...

"BackgroundColor", [1.0 1.0 1.0], "Relief", "ridge", "HorizontalAlignment", "center");

y_out_edit = uicontrol(f, "Position", [155 115 60 20],...

"Style", "text",...

"String", "y",...

"BackgroundColor", [0.95 0.95 0.95], "Relief", "ridge", "HorizontalAlignment", "center");

// "" X_inp

disp_button_70 = uicontrol(f, "Position", [220 115 100 22],...

"Style", "pushbutton", "BackgroundColor", [0.95 0.95 0.95],...

"FontSize", 11,...

"String", "OK",...

"callback", "[j0, xinp]=vvod(xinp, j0)", "tag", "d70");

disp_button_111 = uicontrol(f, "Position", [220 205 100 22],...

"Style", "pushbutton", "BackgroundColor", [0.95 0.95 0.95],...

"FontSize", 11,...

"String", "OK",...

"callback", "[j3, y]=vvod3(x0, h, n, y, i, j3)", "visible", "off", "tag", "d111");

//

theslider_70 = uicontrol(f, "Position", [20 87 300 20],...

"Style", "slider",...

"Min", 1,...

"Max", 50,...

"Value", 0,...

"SliderStep", [1 10],...

"Tag", "slider70",...

"Callback", "slider_update(2, j0, j1, j2, j3, x, y, xinp);", "Relief", "ridge");

//

edit_frame_title_80 = uicontrol(f, "Position", [20 205 300 20],...

"Style", "edit",...

"String", " ",...

"BackgroundColor", [1 1 1], "Relief", "ridge", "HorizontalAlignment", "left", "visible", "off", "tag", "ff1");

disp_button_80 = uicontrol(f, "Position", [20 180 235 20],...

"Style", "pushbutton", "BackgroundColor", [0.95 0.95 0.95],...

"FontSize", 11,...

"String", "",...

"callback", "getf(2)", "visible", "off", "tag", "ff2");

disp_button_81 = uicontrol(f, "Position", [260 180 60 20],...

"Style", "pushbutton", "BackgroundColor", [0.95 0.95 0.95],...

"FontSize", 11,...

"String", "",...

"callback", "", "visible", "off", "tag", "ff3");

 

// X Y

//

edit_frame_title_90 = uicontrol(f, "Position", [20 205 15 20],...

"Style", "text",...

"String", "0",...

"BackgroundColor", [1.0 1.0 1.0], "tag", "kb1");

// X

edit_frame_title_91 = uicontrol(f, "Position", [35 205 25 20],...

"Style", "text",...

"String", "=",...

"BackgroundColor", [1.0 1.0 1.0], "Relief", "ridge", "HorizontalAlignment", "center", "tag", "kb2");

x_edit = uicontrol(f, "Position", [60 205 60 20],...

"Style", "edit",...

"FontSize", 11,...

"String", "1",...

"BackgroundColor", [0.95 0.95 0.95],...

"tag", "kb3");

// x0 -

x10_edit = uicontrol(f, "Position", [60 205 60 20],...

"Style", "text",...

"FontSize", 11,...

"String", "",...

"BackgroundColor", [0.95 0.95 0.95],...

"tag", "kb10", "visible", "off", "Relief", "ridge", "HorizontalAlignment", "center");

// Y

edit_frame_title_92 = uicontrol(f, "Position", [130 205 25 20],...

"Style", "text",...

"String", "y=",...

"BackgroundColor", [1.0 1.0 1.0], "Relief", "ridge", "HorizontalAlignment", "center", "tag", "kb4");

y_edit = uicontrol(f, "Position", [155 205 60 20],...

"Style", "edit",...

"FontSize", 11,...

"String", "1",...

"BackgroundColor", [0.95 0.95 0.95],...

"tag", "kb5");

// ""

disp_button_90 = uicontrol(f, "Position", [220 205 100 22],...

"Style", "pushbutton", "BackgroundColor", [0.95 0.95 0.95],...

"FontSize", 11,...

"String", "OK",...

"callback", "[j1, x, y]=vvod1(x, y, j3)", "tag", "kb6");

//

theslider_90 = uicontrol(f, "Position", [20 180 300 20],...

"Style", "slider",...

"Min", 1,...

"Max", 50,...

"Value", 0,...

"SliderStep", [1 10],...

"Callback", "slider_update(3, j0, j1, j2, j3, x, y, xinp);", "Relief", "ridge", "tag", "kb7");

theslider_901 = uicontrol(f, "Position", [20 180 300 20],...

"Style", "slider",...

"Min", 1,...

"Max", 50,...

"Value", 1,...

"SliderStep", [1 10],...

"Callback", "i=slider901_update(n);", "Relief", "ridge", "tag", "901", "visible", "off");

 

// X(0), h, n

//

// X(0)

edit_frame_title_100 = uicontrol(f, "Position", [20 190 25 20],...

"Style", "text",...

"String", "x0=",...

"BackgroundColor", [1.0 1.0 1.0], "Relief", "ridge", "HorizontalAlignment", "center", "visible", "off", "tag", "newtone1");

x0_edit = uicontrol(f, "Position", [45 190 50 20],...

"Style", "edit",...

"FontSize", 11,...

"String", "1",...

"BackgroundColor", [0.95 0.95 0.95],...

"Tag", "x0", "visible", "off", "tag", "newtone2");

// h

edit_frame_title_102 = uicontrol(f, "Position", [100 190 25 20],...

"Style", "text",...

"String", "h=",...

"BackgroundColor", [1.0 1.0 1.0], "Relief", "ridge", "HorizontalAlignment", "center", "visible", "off", "tag", "newtone3");

h_out_edit = uicontrol(f, "Position", [125 190 50 20],...

"Style", "edit",...

"FontSize", 11,...

"String", "1",...

"BackgroundColor", [0.95 0.95 0.95],...

"Tag", "h", "visible", "off", "tag", "newtone4");

// n

edit_frame_title_103 = uicontrol(f, "Position", [180 190 25 20],...

"Style", "text",...

"String", "n=",...

"BackgroundColor", [1.0 1.0 1.0], "Relief", "ridge", "HorizontalAlignment", "center", "visible", "off", "tag", "newtone5");

n_out_edit = uicontrol(f, "Position", [205 190 50 20],...

"Style", "edit",...

"FontSize", 11,...

"String", "1",...

"BackgroundColor", [0.95 0.95 0.95],...

"Tag", "n", "visible", "off", "tag", "newtone6");

// ""

disp_button_100 = uicontrol(f, "Position", [260 190 60 22],...

"Style", "pushbutton", "BackgroundColor", [0.95 0.95 0.95],...

"FontSize", 11,...

"String", "OK",...

"callback", "[j2, x, x0, n, h]=vvod2(x0, n, h, j2)", "visible", "off", "tag", "newtone7");

//

function gui_lag()

if get(radio_lag, 'value')==1 then

set(findobj("tag", "new"), "value", 0);

lag1();

lag2();

end

endfunction

//

function gui_new()

if get(radio_new, 'value')==1 then

set(findobj("tag", "lag"), "value", 0);

new1();

new2();

end

endfunction

function lag()

lag1();

lag2();

set(findobj("tag", "kb3"), "visible", "off");

set(findobj("tag", "kb10"), "visible", "on");

set(findobj("tag", "kb6"), "visible", "off");

set(findobj("tag", "d111"), "visible", "on");

set(findobj("tag", "kb7"), "visible", "off");

set(findobj("tag", "901"), "visible", "on");

endfunction

//

function lag1()

set(findobj("tag", "newtone1"), "visible", 'off');

set(findobj("tag", "newtone2"), "visible", 'off');

set(findobj("tag", "newtone3"), "visible", 'off');

set(findobj("tag", "newtone4"), "visible", 'off');

set(findobj("tag", "newtone5"), "visible", 'off');

set(findobj("tag", "newtone6"), "visible", 'off');

set(findobj("tag", "newtone7"), "visible", 'off');

set(findobj("tag", "d111"),"visible", "off");

set(findobj("tag", "901"), "visible", "off");

ff_off();

endfunction

//

function lag2()

set(findobj("tag", "kb1"), "visible", 'on');

set(findobj("tag", "kb2"), "visible", 'on');

set(findobj("tag", "kb3"), "visible", 'on');

set(findobj("tag", "kb4"), "visible", 'on');

set(findobj("tag", "kb5"), "visible", 'on');

set(findobj("tag", "kb6"), "visible", 'on');

set(findobj("tag", "kb7"), "visible", 'on');

set(findobj("tag", "d111"),"visible", "off");

set(findobj("tag", "901"), "visible", "off");

ff_off();

endfunction

//

function new1()

set(findobj("tag", "newtone1"), "visible", 'on');

set(findobj("tag", "newtone2"), "visible", 'on');

set(findobj("tag", "newtone3"), "visible", 'on');

set(findobj("tag", "newtone4"), "visible", 'on');

set(findobj("tag", "newtone5"), "visible", 'on');

set(findobj("tag", "newtone6"), "visible", 'on');

set(findobj("tag", "newtone7"), "visible", 'on');

set(findobj("tag", "d111"),"visible", "off");

set(findobj("tag", "901"), "visible", "off");

ff_off();

endfunction

//

function new2()

set(findobj("tag", "kb1"), "visible", 'off');

set(findobj("tag", "kb2"), "visible", 'off');

set(findobj("tag", "kb3"), "visible", 'off');

set(findobj("tag", "kb4"), "visible", 'off');

set(findobj("tag", "kb5"), "visible", 'off');

set(findobj("tag", "kb6"), "visible", 'off');

set(findobj("tag", "kb7"), "visible", 'off');

ff_off();

endfunction

//

function ff()

set(findobj("tag", "ff1"), "visible", 'on');

set(findobj("tag", "ff2"), "visible", 'on');

set(findobj("tag", "ff3"), "visible", 'on');

set(findobj("tag", "d111"),"visible", "off");

set(findobj("tag", "901"), "visible", "off");

endfunction

//

function ff_off()

set(findobj("tag", "ff1"), "visible", 'off');

set(findobj("tag", "ff2"), "visible", 'off');

set(findobj("tag", "ff3"), "visible", 'off');

set(findobj("tag", "d111"),"visible", "off");

set(findobj("tag", "901"), "visible", "off");

endfunction

//

function enter_kb()

if get(radio_kb, 'value')==1 then

set(findobj("tag", "rlf"), "value", 0);

end

if get(radio_new, 'value')==1 then

new1();

new2();

end

if get(radio_lag, 'value')==1 then

lag1();

lag2();

end

endfunction

//

function enter_lf()

if get(radio_lf, 'value')==1 then

set(findobj("tag", "rkb"), "value", 0);

end

lag1();

new2();

ff();

endfunction

//

function slider_update(a, j0, j1, j2, j3, x, y, xinp)

if a==1 then

sl = findobj("Tag", "slider30");

txt = findobj("Tag", "text30");

set(txt, "String", string(get(sl, "Value")));

end

if a==2 then

sl = findobj("Tag", "slider70");

txt = findobj("Tag", "text70");

i=get(sl, "Value");

set(txt, "String", string(get(sl, "Value")));

if j0>=i then

v=xinp(i);

set(findobj("tag", "x_out"), "String", string(v)); end

end

if a==3 then

sl = findobj("Tag", "kb7");

txt = findobj("Tag", "kb1");

set(txt, "String", string(get(sl, "Value")));

end

endfunction

// 901

function i=slider901_update(n)

set(findobj("tag", "901"), "max", n);

sl = findobj("Tag", "901");

disp(sl);

txt=findobj("tag", "kb1");

i=get(sl, "Value");

set(txt, "String", string(i-1));

x0=x0+h*(i-1);

a=string(x0);

set(findobj("tag", "kb10"), "string", a);

endfunction

// X_inp

function [j0, xinp]=vvod(xinp, j0)

sl = findobj("Tag", "slider70");

i=get(sl, "Value");

if (i+1)>j0 then

j0=i;

end

a=evstr(get(x_out_edit, "string"));

xinp(i)=a;

endfunction

set(findobj("tag", "ff2"), "visible", 'off');

set(findobj("tag", "ff3"), "visible", 'off');

set(findobj("tag", "d111"),"visible", "off");

set(findobj("tag", "901"), "visible", "off");

endfunction

//

function lag2()

set(findobj("tag", "kb1"), "visible", 'on');

set(findobj("tag", "kb2"), "visible", 'on');

set(findobj("tag", "kb3"), "visible", 'on');

set(findobj("tag", "kb4"), "visible", 'on');

set(findobj("tag", "kb5"), "visible", 'on');

set(findobj("tag", "kb6"), "visible", 'on');

set(findobj("tag", "kb7"), "visible", 'on');

set(findobj("tag", "d111"),"visible", "off");

set(findobj("tag", "901"), "visible", "off");

ff_off();

endfunction

//

function new1()

set(findobj("tag", "newtone1"), "visible", 'on');

set(findobj("tag", "newtone2"), "visible", 'on');

set(findobj("tag", "newtone3"), "visible", 'on');

set(findobj("tag", "newtone4"), "visible", 'on');

set(findobj("tag", "newtone5"), "visible", 'on');

set(findobj("tag", "newtone6"), "visible", 'on');

set(findobj("tag", "newtone7"), "visible", 'on');

set(findobj("tag", "d111"),"visible", "off");

set(findobj("tag", "901"), "visible", "off");

ff_off();

endfunction

//

function new2()

set(findobj("tag", "kb1"), "visible", 'off');

set(findobj("tag", "kb2"), "visible", 'off');

set(findobj("tag", "kb3"), "visible", 'off');

set(findobj("tag", "kb4"), "visible", 'off');

set(findobj("tag", "kb5"), "visible", 'off');

set(findobj("tag", "kb6"), "visible", 'off');

set(findobj("tag", "kb7"), "visible", 'off');

ff_off();

endfunction

//

function ff()

set(findobj("tag", "ff1"), "visible", 'on');

set(findobj("tag", "ff2"), "visible", 'on');

set(findobj("tag", "ff3"), "visible", 'on');

set(findobj("tag", "d111"),"visible", "off");

set(findobj("tag", "901"), "visible", "off");

endfunction

//

function ff_off()

set(findobj("tag", "ff1"), "visible", 'off');

 

// x, y

function [j1, x, y]=vvod1(x, y, j1)

sl = findobj("Tag", "kb7");

i=get(sl, "Value");

if (i+1)>j1 then

j1=i;

end

a=evstr(get(x_edit, "string"));

x(i)=a;

b=evstr(get(y_edit, "string"));

y(i)=b;

endfunction

set(findobj("tag", "ff2"), "visible", 'off');

set(findobj("tag", "ff3"), "visible", 'off');

set(findobj("tag", "d111"),"visible", "off");

set(findobj("tag", "901"), "visible", "off");

endfunction

//

function lag2()

set(findobj("tag", "kb1"), "visible", 'on');

set(findobj("tag", "kb2"), "visible", 'on');

set(findobj("tag", "kb3"), "visible", 'on');

set(findobj("tag", "kb4"), "visible", 'on');

set(findobj("tag", "kb5"), "visible", 'on');

set(findobj("tag", "kb6"), "visible", 'on');

set(findobj("tag", "kb7"), "visible", 'on');

set(findobj("tag", "d111"),"visible", "off");

set(findobj("tag", "901"), "visible", "off");

ff_off();

endfunction

//

function new1()

set(findobj("tag", "newtone1"), "visible", 'on');

set(findobj("tag", "newtone2"), "visible", 'on');

set(findobj("tag", "newtone3"), "visible", 'on');

set(findobj("tag", "newtone4"), "visible", 'on');

set(findobj("tag", "newtone5"), "visible", 'on');

set(findobj("tag", "newtone6"), "visible", 'on');

set(findobj("tag", "newtone7"), "visible", 'on');

set(findobj("tag", "d111"),"visible", "off");

set(findobj("tag", "901"), "visible", "off");

ff_off();

endfunction

//

function new2()

set(findobj("tag", "kb1"), "visible", 'off');

set(findobj("tag", "kb2"), "visible", 'off');

set(findobj("tag", "kb3"), "visible", 'off');

set(findobj("tag", "kb4"), "visible", 'off');

set(findobj("tag", "kb5"), "visible", 'off');

set(findobj("tag", "kb6"), "visible", 'off');

set(findobj("tag", "kb7"), "visible", 'off');

ff_off();

endfunction

//

function ff()

set(findobj("tag", "ff1"), "visible", 'on');

set(findobj("tag", "ff2"), "visible", 'on');

set(findobj("tag", "ff3"), "visible", 'on');

set(findobj("tag", "d111"),"visible", "off");

set(findobj("tag", "901"), "visible", "off");

endfunction

//

function ff_off()

set(findobj("tag", "ff1"), "visible", 'off');

 

// x0, n, h

function [j2, x, x0, n, h]=vvod2(x0, n, h, j2)

x0=evstr(get(x0_edit, "string"));

n=evstr(get(n_out_edit, "string"));

h=evstr(get(h_out_edit, "string"));

lag();

for j=1:n

x(j)=x0+h*(j-1);

end

set(findobj("tag", "kb10"), "String", string(x0));

if (i+1)>j2 then

j2=i;

end

endfunction

//

function yout=inter1(x, y, xinp, i)

if get(findobj("tag", "lag"), "value")==1 then flag=0; else flag=1; end

x=x';

y=y';

xinp=xinp';

exec("inter.sci');

yout= inter(x, y, xinp, flag);

disp("yout");

disp(yout);

plot2d(x,y,2,"001")

plot(XX, YY,'mo.')

plot2d(x, y, style=color("blue"));

endfunction

// ,

function [j3, y]=vvod3(x0, h, n, y, i, x, j3)

y(i)=evstr(get(y_edit, "string"));

plot(x(i),y(i), 'bo.')

if (i+1)>j3 then

j3=i;

end

endfunction

// X(0)

edit_frame_title_100 = uicontrol(f, "Position", [20 190 25 20],...

"Style", "text",...

"String", "x0=",...

"BackgroundColor", [1.0 1.0 1.0], "Relief", "ridge", "HorizontalAlignment", "center", "visible", "off", "tag", "newtone1");

x0_edit = uicontrol(f, "Position", [45 190 50 20],...

"Style", "edit",...

"FontSize", 11,...

"String", "1",...

"BackgroundColor", [0.95 0.95 0.95],...

"Tag", "x0", "visible", "off", "tag", "newtone2");

// h

edit_frame_title_102 = uicontrol(f, "Position", [100 190 25 20],...

"Style", "text",...

"String", "h=",...

"BackgroundColor", [1.0 1.0 1.0], "Relief", "ridge", "HorizontalAlignment", "center", "visible", "off", "tag", "newtone3");

h_out_edit = uicontrol(f, "Position", [125 190 50 20],...

"Style", "edit",...

"FontSize", 11,...

"String", "1",...

"BackgroundColor", [0.95 0.95 0.95],...

"Tag", "h", "visible", "off", "tag", "newtone4");

 

// (plotframe)

xx=[0:0.1:5]';

yy=(xx^2);

XX=[1:1:4];

YY=(XX^2);

rect=[min(x),min(y),max(x),max(y)];

plotframe(rect,flags=[%t,%f],Captions=["","x","y"],subwin=[0.4,0,0.65,0.75])

legend('f1= ', 'f2= ', 2, %t);





:


: 2015-10-21; !; : 359 |


:

:

, .
==> ...

1572 - | 1346 -


© 2015-2024 lektsii.org - -

: 0.403 .