Code covered by the BSD License  

Highlights from
Best Fit Legend

image thumbnail

Best Fit Legend

by

 

the best tool for signal processing, of a section of your data.

BestFitInfo(varargin)
function varargout = BestFitInfo(varargin)
% BESTFITINFO MATLAB code for BestFitInfo.fig

% Last Modified by GUIDE v2.5 06-Oct-2011 14:56:41

% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',       mfilename, ...
                   'gui_Singleton',  gui_Singleton, ...
                   'gui_OpeningFcn', @BestFitInfo_OpeningFcn, ...
                   'gui_OutputFcn',  @BestFitInfo_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 BestFitInfo is made visible.
function BestFitInfo_OpeningFcn(hObject, eventdata, handles, varargin)
global SS
set(handles.text_NumPoints, 'string', num2str(SS.NumPIn)),
set(handles.text_PercenofPoints, 'string', num2str(SS.PercD)),
set(handles.edit_poly_Deg, 'string', num2str(SS.n)),
global ff
ff.NumPIn = handles.text_NumPoints;
ff.PercD = handles.text_PercenofPoints;
ff.n = handles.edit_poly_Deg;
ff.fitFormula = handles.axes1;
ff.CorrCoeff = handles.text_CorrCoeff;
ff.statisticType = handles.popupmenu_statistic_Selection;
ff.FirstPoint = handles.text_FirstPoint;
ff.lineselect = handles.popupmenu_Line_Select;
ff.LineSelectionUpdated = 1;

%initialize the GUI
set(handles.popupmenu_line_shape, 'value', 1),
set(handles.axes1,'YTick',[]);
set(handles.axes1,'XTick',[]);
set(handles.axes1,'Box','on');
UodatePopUp(handles.popupmenu_Line_Select, SS.liststr),
% Choose default command line output for BestFitInfo
handles.output = hObject;

% Update handles structure
guidata(hObject, handles);
% --- Outputs from this function are returned to the command line.
function varargout = BestFitInfo_OutputFcn(hObject, eventdata, handles)
varargout{1} = handles.output;
% --- Executes on selection change in popupmenu_Line_Select.
function popupmenu_Line_Select_Callback(hObject, eventdata, handles)
global SS
global ff
set(handles.text_NumPoints, 'string', num2str(SS.NumPIn)),
set(handles.text_PercenofPoints, 'string', num2str(SS.PercD)),

ff.LineSelectionUpdated = 1;
%update the screen after the execution of call back to information on newly
%selected line.
rect_pos = SS.rect_api.getPosition();
setPosition(SS.rect_api,[rect_pos(1) rect_pos(2) rect_pos(3) rect_pos(4)+0.01]);
setPosition(SS.rect_api,rect_pos);

% Update handles structure
guidata(hObject, handles);
% --- Executes during object creation, after setting all properties.
function popupmenu_Line_Select_CreateFcn(hObject, eventdata, handles)
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end
function edit_poly_Deg_Callback(hObject, eventdata, handles)
% --- Executes during object creation, after setting all properties.
%update the screen after the execution of call back to information on newly
%selected line.
global SS
rect_pos = SS.rect_api.getPosition();
setPosition(SS.rect_api,[rect_pos(1) rect_pos(2) rect_pos(3) rect_pos(4)+0.01]);
setPosition(SS.rect_api,rect_pos);

function edit_poly_Deg_CreateFcn(hObject, eventdata, handles)
% hObject    handle to edit_poly_Deg (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 selection change in popupmenu_statistic_Selection.
function popupmenu_statistic_Selection_Callback(hObject, eventdata, handles)
% Hints: contents = cellstr(get(hObject,'String')) returns popupmenu_statistic_Selection contents as cell array
%        contents{get(hObject,'Value')} returns selected item from popupmenu_statistic_Selection
global SS
%update the screen after the execution of call back to information on newly
%selected line.
rect_pos = SS.rect_api.getPosition();
setPosition(SS.rect_api,[rect_pos(1) rect_pos(2) rect_pos(3) rect_pos(4)+0.01]);
setPosition(SS.rect_api,rect_pos);

% --- Executes during object creation, after setting all properties.
function popupmenu_statistic_Selection_CreateFcn(hObject, eventdata, handles)
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end

% --- Executes when user attempts to close BestFitInfoFigure.
function BestFitInfoFigure_CloseRequestFcn(hObject, eventdata, handles)
global SS
try
    delete(SS.rect_api),
catch
end
clc,
try
    delete(findobj(0, 'type', 'figure', 'user', 'delete_me')),
catch
    %ignore any error and close.
end
delete(hObject);
% --- Executes on selection change in popupmenu_line_shape.
function popupmenu_line_shape_Callback(hObject, eventdata, handles)
% Hints: contents = cellstr(get(hObject,'String')) returns popupmenu_line_shape contents as cell array
%        contents{get(hObject,'Value')} returns selected item from popupmenu_line_shape
global ff
global SS
switch get(handles.popupmenu_line_shape, 'value')
    case 1
        handles.LT = 'O';
    case 2
        handles.LT = 'X';
    case 3
        handles.LT = '*';
    case 4
        handles.LT = ':';
    case 5
        handles.LT = '-';
    case 6
        handles.LT = '+';
    case 7
        handles.LT = '';
    case 8
        handles.LT = '--';
    case 9
        handles.LT = '--bs';
    case 10
        %handles.LT = 'do special';
    case 11
        handles.LT = '-.ok';
    case 12
        handles.LT = '-*k';
        
end
try
    ff.LineType = handles.LT;
catch
end
%update the screen after the execution of call back to information on newly
%selected line.
rect_pos = SS.rect_api.getPosition();
setPosition(SS.rect_api,[rect_pos(1) rect_pos(2) rect_pos(3) rect_pos(4)+0.01]);
setPosition(SS.rect_api,rect_pos);
% Update handles structure
guidata(hObject, handles);
% --- Executes during object creation, after setting all properties.
function popupmenu_line_shape_CreateFcn(hObject, eventdata, handles)
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end

Contact us