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!