Code covered by the BSD License  

Highlights from
Non-linear regression GUI

image thumbnail

Non-linear regression GUI

by

 

This GUI solves model-based non-linear regression problems of the univariate and multivariate form.

nlinreg(varargin)
function varargout = nlinreg(varargin)
% This function together with nlinreg.fig provides a suitable grafical user
% interface (GUI) to solve parametric non-linear regression problems 
% (univariate or multivariate). The calculations are performed using one of
% the following algorithms (selected by the user):
%  - nlinfit (only univariate problems)
%  - lsqnonlin
%  - patternsearch
%
% The model to be fitted must be written in a M-file in vectorized form:
%   ypred = model(x,xdata)
% ypred is a column vector (univariate problem) or matrix (multivariate
% problem) with the model response (observations in rows).
% x is a vector with the parameters to be fitted.
% xdata is a matrix with the independent variables in columns and
% observations in rows.
% 
% Example: univariate and multivariate problems
% Requierments: Matlab 7.8.0 (R2009a), Optimzation toolbox/ Statistic
% toolbox/ Genetic algorithm and direct search toolbox depending on the
% selected solver.


% NLINREG M-file for nlinreg.fig
%      NLINREG, by itself, creates a new NLINREG or raises the existing
%      singleton*.
%
%      H = NLINREG returns the handle to a new NLINREG or the handle to
%      the existing singleton*.
%
%      NLINREG('CALLBACK',hObject,eventData,handles,...) calls the local
%      function named CALLBACK in NLINREG.M with the given input arguments.
%
%      NLINREG('Property','Value',...) creates a new NLINREG or raises the
%      existing singleton*.  Starting from the left, property value pairs are
%      applied to the GUI before nlinreg_OpeningFcn gets called.  An
%      unrecognized property name or invalid value makes property application
%      stop.  All inputs are passed to nlinreg_OpeningFcn via varargin.
%
%      *See GUI Options on GUIDE's Tools menu.  Choose "GUI allows only one
%      instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES

% Edit the above text to modify the response to help nlinreg

% Last Modified by GUIDE v2.5 15-Dec-2009 17:13:13

% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',       mfilename, ...
                   'gui_Singleton',  gui_Singleton, ...
                   'gui_OpeningFcn', @nlinreg_OpeningFcn, ...
                   'gui_OutputFcn',  @nlinreg_OutputFcn, ...
                   'gui_LayoutFcn',  [] , ...
                   'gui_Callback',   []);
if nargin && ischar(varargin{1})
    gui_State.gui_Callback = str2func(varargin{1});
end

if nargout
    [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
    gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT


% --- Executes just before nlinreg is made visible.
function nlinreg_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject    handle to figure
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
% varargin   command line arguments to nlinreg (see VARARGIN)

% Choose default command line output for nlinreg
handles.output = hObject;

set(handles.edit_File,'String','NewFit');
set(handles.edit_Weights,'Style','text');

handles.Problem.FileName = 'NewFit';
Solver_List = get(handles.popupmenu_Solver,'String');
handles.Problem.Solver = Solver_List{1};
handles.Problem.Weights = [];
handles.Problem.WeightsAuto = 0;
handles.Results = [];

% Update handles structure
guidata(hObject, handles);

% UIWAIT makes nlinreg wait for user response (see UIRESUME)
% uiwait(handles.figure1);


% --- Outputs from this function are returned to the command line.
function varargout = nlinreg_OutputFcn(hObject, eventdata, handles) 
% varargout  cell array for returning output args (see VARARGOUT);
% hObject    handle to figure
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Get default command line output from handles structure
varargout{1} = handles.output;


% --- Executes on selection change in popupmenu_Solver.
function popupmenu_Solver_Callback(hObject, eventdata, handles)
% hObject    handle to popupmenu_Solver (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: contents = get(hObject,'String') returns popupmenu_Solver contents as cell array
%        contents{get(hObject,'Value')} returns selected item from popupmenu_Solver

switch get(hObject,'Value');
    case 1
        set(handles.edit_Weights,'Style','text');
        set(handles.checkbox_Robust,'Enable','on');
    otherwise
        set(handles.edit_Weights,'Style','edit');
        set(handles.checkbox_Robust,'Enable','inactive');
        set(handles.checkbox_Robust,'Value',0);
end

Solver_list = get(hObject,'String');
handles.Problem.Solver = Solver_list{get(hObject,'Value')};
guidata(hObject, handles);


% --- Executes during object creation, after setting all properties.
function popupmenu_Solver_CreateFcn(hObject, eventdata, handles)
% hObject    handle to popupmenu_Solver (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: popupmenu controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end


% --- Executes on button press in pushbutton_Start.
function pushbutton_Start_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton_Start (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% DATA:
fun = handles.Problem.Model;
switch get(handles.checkbox_Start_point,'Value')
    case 0
        a0 = handles.Problem.a0;
    case 1     % The last solution is used as starting point
        Table = get(handles.uitable_Parameters,'Data');
        a0 = Table(:,1);
end
Xdata = handles.Problem.XData;
ydata = handles.Problem.YData;
wi = handles.Problem.Weights;
[M,N] = size(ydata);

% Weights vector when fitting more than one function:
switch handles.Problem.WeightsAuto
    case 0
        if wi
        else
            wi = ones(1,N);
        end
    case 1      % The weights are calculated automatically: 
        wi = 1./(max(ydata,[],1)).^2;
end

% CALCULATIONS:
logtext = get(handles.text_log,'String');
set(handles.text_log,'String',char(logtext((end-4)*((end-4)>0)+1:end,:),'Running ...'));
switch get(handles.popupmenu_Solver,'Value')
    case 1      % nlinfit (univariate problems)
        options = [];
        switch get(handles.checkbox_DisplayIter,'Value')
            case 1
                options = statset('Display','iter');
        end
        switch get(handles.checkbox_Robust,'Value')
            case 1
                options = statset('Robust','on');
        end
        [a,res,J,COVB,mse] = nlinfit(Xdata,ydata,fun,a0,options);
        ci = nlparci(a,res,'covar',COVB);
        a_ci = (ci(:,2)-ci(:,1))/2;
        [ypred,ydelta] = nlpredci(fun,Xdata,a,res,'covar',COVB);
        
    case 2      % lsqnonlin (multivariate problems: more than one function to fit)
        objfun = @(a) (ydata-eval([fun '(a,Xdata)'])).*repmat(wi.^(1/2),M,1);
        [a,resnorm,residual,exitflag,output,lambda,J] = lsqnonlin(objfun,a0);
        ci = nlparci(a,residual,'jacobian',J);
        a_ci = (ci(:,2)-ci(:,1))/2;
        
        ypred = eval([fun '(a,Xdata)']);
        res = ydata-ypred;
        mse = sum(sum(res.^2));
        COVB = [];
        
    case 3      % patternsearch (univariate or multivariate problems)
        objfun = @(a) sum(sum((ydata-eval([fun '(a,Xdata)'])).^2).*wi);
        a = patternsearch(objfun,a0);
        ypred = eval([fun '(a,Xdata)']);
        res = ydata-ypred;
        COVB = [];
        mse = sum(sum(res.^2));
        a_ci = [];
end

logtext = get(handles.text_log,'String');
set(handles.text_log,'String',char(logtext((end-4)*((end-4)>0)+1:end,:),'Finished'));

% RESULTS:
set(handles.uitable_Parameters,'Data',[a a_ci]);
set(handles.uitable_COVB,'Data',COVB);
set(handles.text_mse,'String',num2str(mse));

% PLOTS:
switch N
    case 1      % Univariate
        axes(handles.axes_res);
        cla;
        hold on
        plot(ydata,res,'bo');
        plot(get(handles.axes_res,'XLim'),[0 0],'k-');
        xlabel('Y Data'),ylabel('Residuals')
        
        axes(handles.axes_YY);
        cla;
        hold on
        plot(ydata,ypred,'bo');
        plot(get(handles.axes_YY,'YLim'),get(handles.axes_YY,'YLim'),'k-');
        axis([get(handles.axes_YY,'YLim') get(handles.axes_YY,'YLim')]);
        xlabel('Y Data'),ylabel('Y Model')
        
    otherwise   % Multivariate
        axes(handles.axes_res);
        cla;
        L = zeros(N,1);
        col = {'b','r','g','c','m','y'};
        hold on        
        for i = 1:N
            plot(ydata(:,i)/max(ydata(:,i)),res(:,i)/max(ydata(:,i)),[col{i} 'o']);
            L(i) = i;
        end
        plot(get(handles.axes_res,'XLim'),[0 0],'k-');
        xlabel('Y Data'),ylabel('Residuals'),legend(num2str(L))
        
        axes(handles.axes_YY);
        cla;
        hold on
        for i = 1:N
            plot(ydata(:,i)/max(ydata(:,i)),ypred(:,i)/max(ydata(:,i)),[col{i} 'o']);
        end
        plot(get(handles.axes_YY,'YLim'),get(handles.axes_YY,'YLim'),'k-');
        axis([get(handles.axes_YY,'YLim') get(handles.axes_YY,'YLim')]);
        xlabel('Y Data'),ylabel('Y Model'),legend(num2str(L))
end

% STORE THE RESULTS:
handles.Results.Parameters = a;
handles.Results.ConfidenceIntervals = a_ci;
handles.Results.CovarianceMatrix = COVB;
handles.Results.mse = mse;
handles.Results.residuals = res;
handles.Results.ypred = ypred;

guidata(hObject, handles);


% --- Executes on button press in pushbutton_Stop.
function pushbutton_Stop_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton_Stop (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

set(handles.text_log,'String',char(get(handles.text_log,'String'),'Stopped by the user'));
return


% --- Executes during object creation, after setting all properties.
function text_log_CreateFcn(hObject, eventdata, handles)
% hObject    handle to text_log (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called



function edit_Model_Callback(hObject, eventdata, handles)
% hObject    handle to edit_Model (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of edit_Model as text
%        str2double(get(hObject,'String')) returns contents of edit_Model as a double

handles.Problem.Model = get(handles.edit_Model,'String');
guidata(hObject, handles);

% --- Executes during object creation, after setting all properties.
function edit_Model_CreateFcn(hObject, eventdata, handles)
% hObject    handle to edit_Model (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end



function edit_Start_point_Callback(hObject, eventdata, handles)
% hObject    handle to edit_Start_point (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of edit_Start_point as text
%        str2double(get(hObject,'String')) returns contents of edit_Start_point as a double

a0 = evalin('base',get(handles.edit_Start_point,'String'));
[m,n] = size(a0);
if n ~= 1
    a0 = a0';
end
handles.Problem.a0 = a0;
guidata(hObject, handles);

% --- Executes during object creation, after setting all properties.
function edit_Start_point_CreateFcn(hObject, eventdata, handles)
% hObject    handle to edit_Start_point (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end



function edit_XData_Callback(hObject, eventdata, handles)
% hObject    handle to edit_XData (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of edit_XData as text
%        str2double(get(hObject,'String')) returns contents of edit_XData as a double


handles.Problem.XData = evalin('base',get(handles.edit_XData,'String'));
guidata(hObject, handles);

% --- Executes during object creation, after setting all properties.
function edit_XData_CreateFcn(hObject, eventdata, handles)
% hObject    handle to edit_XData (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end



function edit_YData_Callback(hObject, eventdata, handles)
% hObject    handle to edit_YData (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of edit_YData as text
%        str2double(get(hObject,'String')) returns contents of edit_YData as a double

handles.Problem.YData = evalin('base',get(handles.edit_YData,'String'));
guidata(hObject, handles);

% --- Executes during object creation, after setting all properties.
function edit_YData_CreateFcn(hObject, eventdata, handles)
% hObject    handle to edit_YData (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end


% --------------------------------------------------------------------
function uipushtool_New_ClickedCallback(hObject, eventdata, handles)
% hObject    handle to uipushtool_New (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

handles.Problem = [];
handles.Results = [];
set(handles.edit_File,'String','NewFit');
set(handles.edit_Model,'String',[]);
set(handles.edit_Start_point,'String',[]);
set(handles.checkbox_Start_point,'Value',0);
set(handles.edit_XData,'String',[]);
set(handles.edit_YData,'String',[]);
set(handles.edit_Weights,'String',[]);
set(handles.checkbox_Weights_auto,'Value',0);
set(handles.text_log,'String',' ');
set(handles.uitable_Parameters,'Data',[]);
set(handles.uitable_COVB,'Data',[]);
set(handles.text_mse,'String',[]);

axes(handles.axes_res);
cla;
axes(handles.axes_YY);
cla;

% --------------------------------------------------------------------
function uipushtool_Open_ClickedCallback(hObject, eventdata, handles)
% hObject    handle to uipushtool_Open (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% This is to load Data from file to the function workspace:
uiopen('LOAD')
handles.Problem = Problem;
handles.Results = Results;
guidata(hObject, handles);

% This is load the Data in the command window workspace:
evalin('base',['load ' Problem.FileName]);

% This is put the data is the screen:
set(handles.edit_File,'String',Problem.FileName);
Solver_list = get(handles.popupmenu_Solver,'String');
for i = 1:length(Solver_list)
    if strcmp(Solver_list{i},handles.Problem.Solver)
        index = i;
    end
end
set(handles.popupmenu_Solver,'Value',index);
set(handles.edit_Model,'String',Problem.Model);
set(handles.edit_Start_point,'String','Problem.a0');
set(handles.edit_XData,'String','Problem.Xdata');
set(handles.edit_YData,'String','Problem.Ydata');
set(handles.checkbox_Weights_auto,'Value',Problem.WeightsAuto);
switch Problem.WeightsAuto
    case 1
        set(handles.edit_Start_point,'String',[]);
        set(handles.edit_Start_point,'Style','text');
    case 0
        set(handles.edit_Start_point,'Style','edit');
end    

switch isempty(Results)
    case 0
        set(handles.uitable_Parameters,'Data',[Results.Parameters Results.ConfidenceIntervals]);
        set(handles.uitable_COVB,'Data',Results.CovarianceMatrix);
        set(handles.text_mse,'String',Results.mse);
        [M,N] = size(Problem.YData);
        
        % PLOTS:
        switch N
            case 1      % Univariate
                axes(handles.axes_res);
                cla;
                hold on
                plot(Problem.YData,Results.residuals,'bo');
                plot(get(handles.axes_res,'XLim'),[0 0],'k-');
                xlabel('Y Data'),ylabel('Residuals')
                
                axes(handles.axes_YY);
                cla;
                hold on
                plot(Problem.YData,Results.ypred,'bo');
                plot(get(handles.axes_YY,'YLim'),get(handles.axes_YY,'YLim'),'k-');
                axis([get(handles.axes_YY,'YLim') get(handles.axes_YY,'YLim')]);
                xlabel('Y Data'),ylabel('Y Model')
                
            otherwise   % Multivariate
                axes(handles.axes_res);
                cla;
                L = zeros(N,1);
                col = {'b','r','g','c','m','y'};
                hold on
                for i = 1:N
                    plot(Problem.YData(:,i)/max(Problem.YData(:,i)),Results.residuals(:,i)/max(Problem.YData(:,i)),[col{i} 'o']);
                    L(i) = i;
                end
                plot(get(handles.axes_res,'XLim'),[0 0],'k-');
                xlabel('Y Data'),ylabel('Residuals'),legend(num2str(L))
                
                axes(handles.axes_YY);
                cla;
                hold on
                for i = 1:N
                    plot(Problem.YData(:,i)/max(Problem.YData(:,i)),Results.ypred(:,i)/max(Problem.YData(:,i)),[col{i} 'o']);
                end
                plot(get(handles.axes_YY,'YLim'),get(handles.axes_YY,'YLim'),'k-');
                axis([get(handles.axes_YY,'YLim') get(handles.axes_YY,'YLim')]);
                xlabel('Y Data'),ylabel('Y Model'),legend(num2str(L))
        end
        
    case 1
        set(handles.uitable_Parameters,'Data',[]);
        set(handles.uitable_COVB,'Data',[]);
        set(handles.text_mse,'String',[]);
        
        axes(handles.axes_res);
        cla;
        axes(handles.axes_YY);
        cla;        
end
set(handles.text_log,'String',['File ' handles.Problem.FileName ' opened']);

% --------------------------------------------------------------------
function uipushtool_Save_ClickedCallback(hObject, eventdata, handles)
% hObject    handle to uipushtool_Save (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

handles.Problem.FileName = get(handles.edit_File,'String');
guidata(hObject, handles);

Problem = handles.Problem;
Results = handles.Results;

%uisave({'Problem','Results'},Problem.FileName);
save(get(handles.edit_File,'String'),'Problem','Results');
logtext = get(handles.text_log,'String');
set(handles.text_log,'String',char(logtext((end-4)*((end-4)>0)+1:end,:),['File Saved as ' get(handles.edit_File,'String')]));


function edit_Weights_Callback(hObject, eventdata, handles)
% hObject    handle to edit_Weights (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of edit_Weights as text
%        str2double(get(hObject,'String')) returns contents of edit_Weights as a double

handles.Problem.Weights = evalin('base',get(handles.edit_Weights,'String'));
guidata(hObject, handles);


% --- Executes during object creation, after setting all properties.
function edit_Weights_CreateFcn(hObject, eventdata, handles)
% hObject    handle to edit_Weights (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end



function edit_File_Callback(hObject, eventdata, handles)
% hObject    handle to edit_File (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of edit_File as text
%        str2double(get(hObject,'String')) returns contents of edit_File as a double

handles.Problem.FileName = get(handles.edit_File,'String');
guidata(hObject, handles);


% --- Executes during object creation, after setting all properties.
function edit_File_CreateFcn(hObject, eventdata, handles)
% hObject    handle to edit_File (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end


% --- Executes on button press in checkbox_Start_point.
function checkbox_Start_point_Callback(hObject, eventdata, handles)
% hObject    handle to checkbox_Start_point (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hint: get(hObject,'Value') returns toggle state of checkbox_Start_point

switch get(hObject,'Value')
    case 1
        set(handles.edit_Start_point,'String',[]);
        set(handles.edit_Start_point,'Style','text');
    case 0
        set(handles.edit_Start_point,'Style','edit');
end


% --- Executes on button press in checkbox_Weights_auto.
function checkbox_Weights_auto_Callback(hObject, eventdata, handles)
% hObject    handle to checkbox_Weights_auto (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hint: get(hObject,'Value') returns toggle state of checkbox_Weights_auto

handles.Problem.WeightsAuto = get(hObject,'Value');
switch get(hObject,'Value')
    case 1
        set(handles.edit_Weights,'String',[]);
        set(handles.edit_Weights,'Style','text');
        handles.Problem.Weights = [];        
    case 0
        set(handles.edit_Weights,'Style','edit');
end
guidata(hObject, handles);


% --- Executes on button press in checkbox_DisplayIter.
function checkbox_DisplayIter_Callback(hObject, eventdata, handles)
% hObject    handle to checkbox_DisplayIter (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hint: get(hObject,'Value') returns toggle state of checkbox_DisplayIter


% --- Executes on button press in checkbox_Robust.
function checkbox_Robust_Callback(hObject, eventdata, handles)
% hObject    handle to checkbox_Robust (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hint: get(hObject,'Value') returns toggle state of checkbox_Robust


% --- Executes on button press in pushbutton_PlotMatrix.
function pushbutton_PlotMatrix_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton_PlotMatrix (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)


figure(2)
plotmatrix(handles.Problem.XData,handles.Problem.YData,'b+');
xlabel('X Data'),ylabel('Y Data')

Contact us