Vision Test: write program that tests participants visual acuity. Display one letter character and have them decrease in size
7 views (last 30 days)
Show older comments
Write program that displays single-letter character in decreasing size. Participants respond with the letter they see by typing it out on the keyboard (not case sensitive, so 'A' and 'a' are fine). Experiment ends if they get 3 trials wrong. Not sure how to the end results match with the actual vision score (missing 3 letters doesn't necessarily mean you have poor eyesight).
Example:
- Screen displays big sized letter 'B'
- Participants types: b
- Next letter is a little smaller than the previous one: 'L'
- Results show: got 3 answers wrong, need to end experiment
% VARIABLES
a = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H','I','J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'];
b = [b a(randperm(26))];
%letter responses
responses = NaN(11,3);
%experiment variables
run_exp = 1;
font_size = 100;
incorrect_count = 0;
trial_size = 1;
trial_number = 1;
% EXPERIMENT
while loop
%TRIAL
% want to make sure plot always shows the character and in front for
% participants to see as they type their response
clf;
text();
%get participant's response
responses();
%ISCORRECT
if statement
%increment to next font size trials
font_size = font_size*.7;
trial_size = trial_size + 1;
trial_number = 1;
%reset incorrect count
incorrect_count = 0;
else
%if 3rd incorrect, then end experiment
incorrect_count = incorrect_count + 1;
if incorrect_count == 3
%end experiment
run_exp = 0;
else
%run next trial number
trial_number = trial_number + 1;
end
end
end
% RESULTS
%close figure and clear cmd window
close all
clc
% show their results
fprintf('\nYou have %s vision!')
0 Comments
Answers (0)
See Also
Categories
Find more on Matrix Indexing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!