⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 asufit.m

📁 ASUFIT-Matlab-全局拟合程序
💻 M
📖 第 1 页 / 共 5 页
字号:
function Asufit(action)

%------------------------------------------------------------------------------
% FILENAME: ASUFIT.M
%
% This is ASUFIT, a general fitting routine written under MATLAB for fitting
% transient emission and absorbance change data.  Any nonprofit organization
% is welcome to use this without charge, but we ask that the program authors
% be acknowleged. Program authors are:
%
%     Evaldas Katilius
%	  Joel Hindorff
%     Neal Woodbury
%
% This file creates the main figure window that is the ASUFIT graphical user
% interface.  The commands in this file set up the uicontrols and prepare
% the MATLAB workspace.
%
% Possible actions of this function are:
%     'initialize'
%     'spc'
%     'abs'
%     'svd'
%     'off'
%------------------------------------------------------------------------------

% Figure and axes handles
global mainWindow
global spcDataGrid
global spcResidGrid
global absDataGrid1
global absDataGrid2
global absResidGrid1
global absResidGrid2
global svdGrid1
global svdGrid2
global svdGrid3
global absIntSetAxes1
global absIntSetAxes2
global spcIntSetAxes

% Menu handles
global expFile
global kineticsFile
global spectrumFile
global ampSpecFile
global spcFitSave
global plot3D
global ampSpecPlot
global subtract
global revert
global spcGlobal
global perform
global components
global glob
global spec
global absDispersion
global restore
global average
global optionsMenu
global plotMenu
     
% Common uicontrol handles
global textBox
global optionsbutton
global plotbutton
global svdbutton
global action1button
global action2button
global action3button

% SPC uicontrol handles
global spcSpectrumText
global spcPromptText
global spcDateText
global spcSpectrumBox
global spcPromptBox
global spcDateBox
global spcExciteText
global spcEmitText
global spctpchText
global spcExciteBox
global spcEmitBox
global spctpchBox
global spcShiftNumText
global spcErrorText
global spcGlobalErrorText
global spcShiftNumBox
global spcErrorBox
global spcGlobalErrorBox
global spcTaoAnsText
global spcTaoAnsBox
global spcAmpAnsText
global spcAmpAnsBox
global spcIntPlot
global spcLeftEnd
global spcRightEnd
global spcTog
global spcPlot
global spcInd
global spcPlotMode
global spcResidPlot

% Absorbance uicontrol handles

global absCurrentWlText
global absCurrentWlBox
global absCurrentTimeText
global absCurrentTimeBox
global absAbsorbText
global absAbsorbBox
global absTaoAnsText
global absTaoAnsBox
global absErrorText
global absErrorBox

% Options screen handles
global spcNumTaoText
global spcNumTaoBox
global spcTaoText
global spcTaoBox
global spcNumTaoFixedText
global spcNumTaoFixedBox
global spcTaoFixedText
global spcTaoFixedBox
global spcNumAllTaoText
global spcNumAllTaoBox
global spcAllTaoText
global spcAllTaoBox
global spcshifttext
global spcshift
%global spcFTolText
%global spcFTolBox
global spcMaxItText
global spcMaxItBox

global absNumTaoText
global absNumTaoBox
global absTaoText
global absTaoBox
global absNumTaoFixedText
global absNumTaoFixedBox
global absTaoFixedText
global absTaoFixedBox
global absNumAllTaoText
global absNumAllTaoBox
global absAllTaoText
global absAllTaoBox
global absPulseWidthText
global absPulseWidthBox
global absShiftGuessText
global absShiftGuessBox
global abscheckboxtext
global abscheckbox1
global abscheckbox2
global abscheckbox3
global absMaxItText
global absMaxItBox
global absDisperCoeffsText
global absDisperCoeffsBox
global absDisperText
global absDisper1Hypertext
global absDisper2Hypertext
global absDisper3Hypertext
global absIntPlot1
global absIntPlot2
global absLeftEnd1
global absRightEnd1
global absLeftEnd2
global absRightEnd2
global absTog1
global absTog2
global absPlotKinSpec
global absInd1
global absInd2
global absPlot1
global absPlot2
global absResidPlot1
global absResidPlot2
global abstimeaxis

%SVD
global svdNumVecsText
global svdNumVecsBox
global svdTimeText
global svdTimeBox
global svdWavelengthText
global svdWavelengthBox
global svdErrorText
global svdErrorBox
global svdWeightText
global svdWeightBox
global svdSurfOld
global svdSurfNew
global svdGlobalTogHypertext
global svdGlobalToggle

%Amps spec
global ampPlotAll
global ampInd
global ampSpecWindow
global ampGrid
global ampUpbutton
global ampDownbutton
global ampClosebutton
global ampTextBox
global ampSwitchbutton

% Absorbance 3D plot variables
global abs3dFig
global abs3dAxes
global abs3dView
global horizRotBox
global vertRotBox

% Book keeping variables

global analysisType %  == 1 -> SPC/IRF
                    %  == 2 -> Absorbance
                    %  == 3 -> SVD of Absorbance
                    % otherwise, no data present in workspace
global dispersionStatus % == 0 -> no dispersion correction
                        % == 1 -> correct during fit
                        % == 2 -> data already changed
global dataIntervalStatus % == 0 -> use all of the data
                          % == 1 -> use interval for fit
                          % == 2 -> use interval now
global backupTypes % == 0 -> no backups
                   % == 1 -> dataBackup1 is data before dispersion and SVD
                   %         dataBackup2 is data with dispersion but before SVD
                   % == 2 -> dataBackup1 is data before dispersion and SVD
                   %         dataBackup2 is data with SVD but before dispersion
global svdAnal
global abstimelin
global fitmodel
                   

% Real variables
global data
global dataMax
global dataMin
global fit
global irf
global amps
global weight
global emit
global excite
global tpch
global date
global spcFilenames
global irfFilenames
global numTao
global tao
global numTaoFixed
global taoFixed
global pulseWidth
global absFilename
global restoreName
global absYTicks
global wavelength
global t
global dataFit
global disperCoeffs
global dispvecguess
global leftInt
global rightInt
global xTol
global fTol
global maxIt
global OPTIONS
global OPT_STOP
global paramsAns
global chisq
global taoAns
global shiftGuess
global shift
global tzero
global fitError
global dataBackup
global U
global S
global V
global numVecs
global dispersionVector
global pathname
global numTimePoints1
global numTimePoints2
global fitconst
global name


if (nargin < 1)
    action = 'initialize';
end

if (strcmp(action, 'initialize'))
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
% This action argument sets up Asufit for the first time, no data is present in
% the workspace.
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

% --- The following commands set up the figure window and all plot axes

	 pathname = 'c:\'; %default data pathname
    mainWindow = ... % Main figure window
        figure(...
            'Name',        'ASUFIT-Data Analysis Software',...
            'NumberTitle', 'off',...
            'MenuBar', 'none',...
            'Units',       'normalized',...
            'Position',    [.05 .05 .9 .9],...
            'Color',       [0.8 0.8 0.8],...
            'Visible',     'off'...
        );
    spcDataGrid = ... % SPC data axes
        axes(...
            'Position',  [0.06 .3 0.88 0.55],...
            'Visible',  'off',...
            'DrawMode', 'fast'...
        );
    spcResidGrid = ... % SPC fit residual axes
        axes(...
            'Position', [0.06 .2 0.88 0.07],...
            'Visible',  'off',...
            'DrawMode', 'fast'...
        );
    absDataGrid1 = ... % Temporal axes for absorbance
        axes(...
            'Position', [0.05 .37 0.425 0.47],...
            'Visible',  'off',...
            'DrawMode', 'fast'...
        );
    absDataGrid2 = ... % Spectral axes for absorbance
        axes(...
            'Position', [0.525 .37 0.425 0.47],...
            'Visible',  'off',...
            'DrawMode', 'fast'...
        );
    absResidGrid1 = ... % Temporal residual axes
        axes( ...
            'Position', [0.05 .12 0.425 0.2],...
            'Visible',  'off',...

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -