How to write a driver test for this function?
h = figure;
set(h,'KeyPressFcn',@KeyPressCb);
function y = KeyPressCb(~,evnt)
fprintf('key pressed: %s\n',evnt.Key);
global s;
if strcmp(evnt.Key,'rightarrow')==1
s = evnt.Key;
elseif strcmp(evnt.Key, 'leftarrow')==1
s = evnt.Key;
elseif strcmp(evnt.Key,'space')==1
s = evnt.Key;
end
end
end
How to write a driver test for this function? h = figure; set(h,'KeyPressFcn',@KeyPressCb); function y = KeyPressCb(~,ev
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
How to write a driver test for this function? h = figure; set(h,'KeyPressFcn',@KeyPressCb); function y = KeyPressCb(~,ev
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!