CatchMe_Main - s Prvw_hndl =...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
% CatchMe_Main.m % Program to acquire eye-hand coordination % Prof Ka C Cheok, 16 Sep 2005 % close all; clear all; c EHC_hndl = figure(1); set(EHC_hndl,. .. 'Name','A "CATCH ME" Eye-Hand Coordination Experiment',. .. 'NumberTitle','off',. .. 'Position',[10 200 600 400],. .. 'Menu','none',. .. 'Resize','off') N1 = 100; dT = 0.01; N = 1000; T = 0:dT:(N-1)*dT; Tp = 0.015; % Pause time Temp = []; while length(Temp) < N Temp = [Temp sign(randn)*rand*ones(1,50+round(rand*100))]; end Ball_pos = Temp(1:N); B Aim_pos = zeros(1,N); Aim_Spot = plot(Aim_pos(N1),0, 'or'); set(gca,'Position',[0.1 0.11 0.7 0.815],'xlim',[-1 1],'ylim',[-1 1]); set(Aim_Spot,'erasemode','xor','linewidth',4); grid; drawnow; hold on; Aim_Line = plot(Aim_pos(N1)*[1 1],[-1 1],'r:'); Aim_Curve = plot(Aim_pos(1:N1),[-1:dT:-1+(N1-1)*dT],'r-','Linewidth',2); A CurrPoint = get(gca,'currentpoint'); Cursor = CurrPoint(1,1:2)'; set(0,'RecursionLimit',10000) set(gcf,'windowbuttondownfcn','B_down','windowbuttonupfcn','B_up')
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: s Prvw_hndl = uicontrol(EHC_hndl,'style','popup','pos',[500 190 70 20],'string',. .. '0.0|0.1|0.2|0.3|0.4|0.5|0.6|0.7|0.8|0.9| 1.0','fontsize',12,'CallBack','CatchMePickPreview'); text(1.6,0.1,'Preview Distance'); Nprvw = (get(Prvw_hndl,'Value')-1)*round(0.1/dT); Nshow = N1+Nprvw; Ball_Line = plot(Ball_pos(Nshow)*[1 1],[-1 0],'b:','Linewidth',2); Ball_Target = plot(Ball_pos(Nshow),-1+(Nshow-1)*dT,'bo', 'Linewidth',5); Ball_Trace = plot(Ball_pos(1:Nshow),[-1:dT:-1+(Nshow-1)*dT],'Linewidth',2); B Start_hndl = uicontrol(EHC_hndl,'style','togglebutton','pos',[500 290 50 60],'string',. .. 'Start','fontsize',12,'CallBack','CatchMeStart'); ViewResult_hndl = uicontrol(EHC_hndl,'style','togglebutton','pos',[500 90 80 60],'string',. .. 'View traces','fontsize',12,'CallBack','CatchMeViewTraces');...
View Full Document

This note was uploaded on 04/17/2011 for the course SYS 635 taught by Professor Re during the Spring '11 term at Albany College of Pharmacy and Health Sciences.

Ask a homework question - tutors are online