Пакет MatLab. Элементы программирования. Функции пакета. Графические возможности пакета, страница 18

mlx=[lx+10 lx+50 lx+50 lx+100 lx+100 lx+50 lx+50];

mly=[ly  ly    ly+12 ly+12  ly-12  ly-12 ly];

text(lx+60,ly,'1/p'); line(mlx,mly);

mlx=[lx+100 lx+150 lx+150 lx+200 lx+200 lx+150 lx+150];

mly=[ly  ly    ly+12 ly+12  ly-12  ly-12 ly];

text(lx+160,ly,'1/p'); line(mlx,mly);

mlx=[lx+10 lx+50 lx+50 lx+100 lx+100 lx+50 lx+50];

mly=[ly-40  ly-40    ly-28 ly-28  ly-52  ly-52 ly-40]; line(mlx,mly);

mlx=[lx lx+50 lx+50 lx+100 lx+100 lx+50 lx+50];

mly=[ly-80  ly-80    ly-68 ly-68  ly-92  ly-92 ly-80]; line(mlx,mly);

mlx=[lx+200 lx+250]; mly=[ly ly]; line(mlx,mly);

mlx=[lx+100 lx+125]; mly=[ly-40 ly-40]; line(mlx,mly);

mlx=[lx+100 lx+225]; mly=[ly-80 ly-80]; line(mlx,mly);

mlx=[lx+225 lx+225]; mly=[ly-80 ly]; line(mlx,mly);

mlx=[lx+125 lx+125]; mly=[ly ly-40]; line(mlx,mly);

mlx=[lx lx]; mly=[ly-80 ly-50]; line(mlx,mly);

mlx=[lx lx]; mly=[ly-30 ly-10]; line(mlx,mly);

mlx=[lx+100 lx+100]; mly=[ly+20 ly+50]; line(mlx,mly);

mlx=[lx+200 lx+200]; mly=[ly+20 ly+50]; line(mlx,mly);

mlx=[lx-10 lx-10 lx+10 lx+10 lx-10 lx+10 lx-10 lx+10];

mly=[ly-10 ly+10 ly+10 ly-10 ly-10 ly+10 ly+10 ly-10]; line(mlx,mly);

mlx=[lx-10 lx-10 lx+10 lx+10 lx-10 lx+10 lx-10 lx+10];

mly=[ly-50 ly-30 ly-30 ly-50 ly-50 ly-30 ly-30 ly-50]; line(mlx,mly);

par_text=uicontrol('Style','text','Position',[it0 jt0 its jts],...

'Units','normalized','BackgroundColor','black',...

'ForegroundColor','white','String','Parameters');

con_text=uicontrol('Style','text','Position',[it0+.13 jt0 its jts],...

'Units','normalized','BackgroundColor','black',...

'ForegroundColor','white','String','Conditions');

ai_text=uicontrol('Style','text','Position',[it0 js0+jss+.03 2*its+.02 jts],...

'Units','normalized','BackgroundColor','black',...

'ForegroundColor','white','String','a1 a2              x10   x20');

a1_sl=uicontrol('Style','slider','Position',[is0 js0 iss jss],...

'Units','normalized','Value',a1,'Max',max_a1,'Min',min_a1,...

'Callback','lab2(''seta1'',1); lab2(''redraw'');');

a2_sl=uicontrol('Style','slider','Position',[is0+.03 js0 iss jss],...

'Units','normalized','Value',a2,'Max',max_a2,'Min',min_a2,...

'Callback','lab2(''seta2'',1); lab2(''redraw'');');

x1_sl=uicontrol('Style','slider','Position',[is0+.13 js0 iss jss],...

'Units','normalized','Value',x0(1),'Max',max_x1,'Min',min_x1,...

'Callback','lab2(''setx1'',1); lab2(''redraw'');');

x2_sl=uicontrol('Style','slider','Position',[is0+.16 js0 iss jss],...

'Units','normalized','Value',x0(2),'Max',max_x2,'Min',min_x2,...

'Callback','lab2(''setx2'',1); lab2(''redraw'');');

close_button=uicontrol('Style','Pushbutton','Position',[.85 .03 .12 .05],...

'Units','normalized','Callback','lab2(''done'')','String','End');

uicontrol('style','text','pos',[it0 js0 iss jts],...

'Units','normalized','BackgroundColor','black',...

'ForegroundColor','white','String',num2str(min_a1));

uicontrol('style','text','pos',[it0+.09 js0 iss jts],...

'Units','normalized','BackgroundColor','black',...

'ForegroundColor','white','String',num2str(min_a2));

uicontrol('style','text','pos',[it0+.13 js0 iss jts],...

'Units','normalized','BackgroundColor','black',...

'ForegroundColor','white','String',num2str(min_x1));

uicontrol('style','text','pos',[it0+.22 js0 iss jts],...

'Units','normalized','BackgroundColor','black',...

'ForegroundColor','white','String',num2str(min_x2));

uicontrol('style','text','pos',[it0 js0+jss-.03 iss jts],...

'Units','normalized','BackgroundColor','black',...

'ForegroundColor','white','String',num2str(max_a1));

uicontrol('style','text','pos',[it0+.09 js0+jss-.03 iss jts],...

'Units','normalized','BackgroundColor','black',...

'ForegroundColor','white','String',num2str(max_a2));

uicontrol('style','text','pos',[it0+.13 js0+jss-.03 iss jts],...

'Units','normalized','BackgroundColor','black',...

'ForegroundColor','white','String',num2str(max_x1));

uicontrol('style','text','pos',[it0+.22 js0+jss-.03 iss jts],...

'Units','normalized','BackgroundColor','black',...

'ForegroundColor','white','String',num2str(max_x2));

ip0=.64; jp0=.07; ips=.16; jps=.03;

p1_t=uicontrol('style','text','pos',[ip0 jp0 ips jps],...