function step = EEGClassification(net, data, step) | |
classNames = {'Left', 'Right', 'Grasp', 'Twist', 'Idle'}; | |
gt = {'Right', 'Grasp', 'Left', 'Twist', 'Left'}; | |
output = forward(net, dlarray(data, 'SSCB')); | |
[~, predictedIndex] = max(output, [], 'all'); | |
if strcmp(classNames{predictedIndex}, gt{step}) | |
step = step + 1; | |
disp([' ๋์ฝ๋ฉ ๊ฒฐ๊ณผ: ' classNames{predictedIndex} '. ๋ง์ต๋๋ค. ๋ค์ ๋จ๊ณ๋ก ๊ฐ๋๋ค.']); | |
else | |
step = 1; | |
disp([' ๋์ฝ๋ฉ ๊ฒฐ๊ณผ: ' classNames{predictedIndex} '. ํ๋ ธ์ต๋๋ค. ๋จ๊ณ 1๋ก ๊ฐ๋๋ค.']); | |
end | |
pause(5); | |
end |