outputs in my function
이전 댓글 표시
Hello,Im need to use the output "a" in other function who calls testkeyboard, but when i do it, occurs the next error:
Output argument "rueda1" (and maybe others) not assigned during call to
this is the code of testkeyboard:
function [rueda1,rueda2,rueda3]=testkeyboard
figure('KeyPressFcn',@printfig);
function [rueda1,rueda2,rueda3] =printfig(~,event)
% Callback to parse keypress event data to print a figure
if event.Character == 'w'
rueda2=0;
rueda1=1;
rueda3=0;
elseif event.Character == 's'
rueda2=0;
rueda1=-1;
rueda3=0;
elseif event.Character == 'a'
rueda2=-1;
rueda1=0;
rueda3=0;
elseif event.Character == 'd'
rueda2=1;
rueda1=0;
rueda3=0;
elseif event.Character == 'i'
rueda2=0;
rueda1=0;
rueda3=1;
elseif event.Character == 'k'
rueda2=0;
rueda1=0;
rueda3=-1;
elseif event.Character == 'j'
rueda2=-1;
rueda1=-1;
rueda3=-1;
elseif event.Character == 'l'
rueda2=1;
rueda1=1;
rueda3=1;
else
rueda2=0;
rueda1=0;
rueda3=0;
end
disp(fprintf('rueda1= %d', rueda1));
disp(fprintf('rueda2= %d', rueda2));
disp(fprintf('rueda3= %d', rueda3));
end
end
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Alignment에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!