04 CatchMeExpt ParaId

# 04 CatchMeExpt ParaId - SYS635 Adaptive Control 04...

This preview shows pages 1–3. Sign up to view the full content.

SYS635 Adaptive Control 04 CatchMeExpt ParaId Prof Ka C Cheok 1 of 8 9/24/2005 A MATLAB Experiment to Acquire and Estimate Eye-Hand Coordination Model The Programs % CatchMe_Main.m % Program to acquire eye-hand coordination % Prof Ka C Cheok, 16 Sep 2005 close all; clear all; 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);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.5 1.5],'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); CurrPoint = get(gca,'currentpoint'); Cursor = CurrPoint(1,1:2)'; set(0,'RecursionLimit',10000) set(gcf,'windowbuttondownfcn','B_down','windowbuttonupfcn','B_up') 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); 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');

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
SYS635 Adaptive Control 04 CatchMeExpt ParaId Prof Ka C Cheok 2 of 8 9/24/2005 % CatchMeStart.m Cursor = [0 ;0 ]; pause(0.5); tic for k = Nshow+1:N set(Ball_Line,'xdata',Ball_pos(k)*[1 1]); set(Ball_Target,'xdata',Ball_pos(k)); set(Ball_Trace,'xdata',Ball_pos(k-Nshow+1:k)); kk = k-Nprvw; Aim_pos(kk) = Cursor(1); set(Aim_Spot, 'xdata',Aim_pos(kk));
This is the end of the preview. Sign up to access the rest of the 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.

### Page1 / 8

04 CatchMeExpt ParaId - SYS635 Adaptive Control 04...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online