From 80e58926c1f2a7e5701b43cffddd76ba08aafe49 Mon Sep 17 00:00:00 2001 From: Eugeniy Mikhailov Date: Thu, 20 Sep 2012 00:28:10 -0400 Subject: check_bound moved to separate function --- check_bound.m | 15 +++++++++++++++ gui_win.m | 16 ---------------- 2 files changed, 15 insertions(+), 16 deletions(-) create mode 100644 check_bound.m diff --git a/check_bound.m b/check_bound.m new file mode 100644 index 0000000..8f14094 --- /dev/null +++ b/check_bound.m @@ -0,0 +1,15 @@ +function [x,adjusted]=check_bound(x,xleft,xright) +% check if number out of bound and then assign it to the mid of the region +if xleft > xright + % sanity check for bounds + tmp=xright; + xright=xleft; + xleft=tmp; +end +if xxright + x=(xleft+xright)/2; + adjusted = true; +else + adjusted = false; +end + diff --git a/gui_win.m b/gui_win.m index 2193b97..e2fb8ba 100644 --- a/gui_win.m +++ b/gui_win.m @@ -774,22 +774,6 @@ else end; -function [x,adjusted]=check_bound(x,xleft,xright) -% check if number out of bound and then assign it to the mid of the region -if xleft > xright - % sanity check for bounds - tmp=xright; - xright=xleft; - xleft=tmp; -end -if xxright - x=(xleft+xright)/2; - adjusted = true; -else - adjusted = false; -end - - %To show the cross on the screen we need to get its coordinates % --- Executes on button press in showcross. function showcross_Callback(hObject, eventdata, handles) -- cgit v1.2.3