📄 ldemo.m
字号:
function ldemo (action, option1);% ----------------------------------------------------------------------% File.....: ldemo.m% Date.....: 19-MAY-1999% Version..: 2.0b% Author...: Peter Joosten (TUD/GEO)% Mathematical Geodesy and Positioning% Delft University of Technology% Purpose..: Demonstration of the LAMBDA-method% Language.: MATLAB 5.1%% Remarks..: This demonstration has some limitations, which do not apply% to the LAMBDA-routines itself:%% - Maximum dimension of the problem = 6% - For readability, all numbers should fit in format "%8.4f"%% Arguments: None% ----------------------------------------------------------------------% ----------------------------------------------------------------------% --- Initialize ---% ----------------------------------------------------------------------if nargin < 1; action = 'initialize'; end;maxdim = 6;curdim = 2;% ----------------------------------------------------------------------% Wait for actions ...% ----------------------------------------------------------------------switch action;case 'initialize'; % ----------------------------------------------- % --- Initialize, which is the default action --- % ----------------------------------------------- % ------------------------------------------- % --- Define default options for controls --- % ------------------------------------------- BackgroundColor = [0.0000 0.5966 1.0000]; % ------------------------------ % --- Create the main figure --- % ------------------------------ ScreenSize = get(0,'ScreenSize'); FigLeft = (ScreenSize(3) - 640) / 2; FigBottom = (ScreenSize(4) - 480) / 2; h = figure (... 'tag','LAMBDA', ... 'name','LAMBDA-demonstration', ... 'position',[FigLeft FigBottom 640 480]); % ---------------------- % --- Action buttons --- % ---------------------- h = uicontrol (... 'Style','Frame', ... 'Position',[552 236 86 242], ... 'BackgroundColor',BackgroundColor); h = uicontrol (... 'Style','Pushbutton', ... 'Position',[555 443 80 32], ... 'String','Compute !', ... 'Callback','ldemo ''compute'''); h = uicontrol (... 'Style','Pushbutton', ... 'Position',[555 408 80 32], ... 'String','About', ... 'Callback','ldemo ''about'''); h = uicontrol (... 'Style','Pushbutton', ... 'Position',[555 373 80 32], ... 'String','Exit', ... 'Callback','ldemo ''exit'''); % ------------------------- % --- Input/Output file --- % ------------------------- h = uicontrol (... 'Style','Frame', ... 'Position',[2 370 518 108], ... 'BackgroundColor',BackgroundColor); h = uicontrol (... 'Style','Text', ... 'Position',[5 447 120 20], ... 'String','Inputfile:', ... 'HorizontalAlignment','Left',... 'BackgroundColor',BackgroundColor); h = uicontrol (... 'Style','Edit', ... 'Position',[130 450 300 20], ... 'HorizontalAlignment','Left', ... 'BackgroundColor',[1 1 1], ... 'Tag','InputFile'); h = uicontrol (... 'Style','Pushbutton', ... 'Position',[435 450 80 20], ... 'String','Select', ... 'Callback','ldemo SelectFile In'); h = uicontrol (... 'Style','Text', ... 'Position',[5 427 120 20], ... 'String','Outputfile:', ... 'HorizontalAlignment','Left',... 'BackgroundColor',BackgroundColor); h = uicontrol (... 'Style','Edit', ... 'Position',[130 430 300 20], ... 'HorizontalAlignment','Left', ... 'BackgroundColor',[1 1 1], ... 'Tag','OutputFile'); h = uicontrol (... 'Style','Pushbutton', ... 'Position',[435 430 80 20], ... 'String','Select', ... 'Callback','ldemo SelectFile Out'); % ---------------------------- % --- Number of candidates --- % ---------------------------- h = uicontrol (... 'Style','Text', ... 'Position',[5 407 120 20], ... 'String','Number of candidates:', ... 'HorizontalAlignment','Left',... 'BackgroundColor',BackgroundColor); h = uicontrol (... 'Style','Edit', ... 'Position',[130 410 50 20], ... 'HorizontalAlignment','Left', ... 'BackgroundColor',[1 1 1], ... 'Tag','ncands', ... 'String',2); % -------------------------------- % --- Dimension of the problem --- % -------------------------------- h = uicontrol (... 'Style','Text', ... 'Position',[5 387 120 20], ... 'String','Dimension:', ... 'HorizontalAlignment','Left',... 'BackgroundColor',BackgroundColor); h = uicontrol (... 'Style','Edit', ... 'Position',[130 390 50 20], ... 'HorizontalAlignment','Left', ... 'BackgroundColor',[1 1 1], ... 'Tag','dimension', ... 'Callback','ldemo dimension', ... 'String',num2str(curdim)); % ------------------------------- % --- Radiobuttons for output --- % ------------------------------- h = uicontrol ( ... 'Style','RadioButton', ... 'Position',[200 410 200 18], ... 'String','No intermediate output', ... 'BackgroundColor',BackgroundColor, ... 'Tag','IntOut0', ... 'Value',1, ... 'Callback','ldemo intout 0'); h = uicontrol ( ... 'Style','RadioButton', ... 'Position',[200 392 200 18], ... 'String','Intermediate output to screen', ... 'BackgroundColor',BackgroundColor, ... 'Tag','IntOut1', ... 'Value',0, ... 'Callback','ldemo intout 1'); h = uicontrol ( ... 'Style','RadioButton', ... 'Position',[200 374 200 18], ... 'String','Intermediate output to file', ... 'BackgroundColor',BackgroundColor, ... 'Tag','IntOut2', ... 'Value',0, ... 'Callback','ldemo intout 2'); % ----------------------------------------- % --- Create a box for Qahat and afloat --- % ----------------------------------------- h = uicontrol (... 'Style','Frame', ... 'Position',[2 236 518 132], ... 'BackgroundColor',BackgroundColor); h = uicontrol (... 'Style','Text', ... 'Position',[7 343 80 20], ... 'String','Float:', ... 'HorizontalAlignment','Left',... 'BackgroundColor',BackgroundColor); h = uicontrol (... 'Style','Text', ... 'Position',[92 343 200 20], ... 'String','Variance/covariance matrix', ... 'HorizontalAlignment','Left',... 'BackgroundColor',BackgroundColor); for j = 1:maxdim; tag = ['float' sprintf('%2.2d',j)]; ix = 5; iy = 328 - (j-1) * 18; h = uicontrol ( ... 'Style','Edit', ... 'Position',[ix iy 80 18], ... 'HorizontalAlignment','Left', ... 'BackgroundColor',[1 1 1], ... 'String','0.0000', ... 'Tag',tag); if j <= curdim; set (h,'Enable','On'); else; set (h,'Enable','Off'); end; end; for i = 1:maxdim; for j = 1:maxdim; tag = ['mat' sprintf('%2.2d',i) sprintf('%2.2d',j)]; ix = 90 + (i-1) * 70; iy = 328 - (j-1) * 18; h = uicontrol ( ... 'Style','Edit', ... 'Position',[ix iy 70 18], ... 'HorizontalAlignment','Left', ... 'BackgroundColor',[1 1 1], ... 'String','0.0000', ... 'Callback',['ldemo makesymm ' tag], ... 'Tag',tag); if j <= curdim & i <= curdim; set (h,'Enable','On'); else; set (h,'Enable','Off'); end; end; end; % ------------------------------------------- % --- Box for elongation of the ellipsoid ---
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -