Maze / EEGClassification.m
nevermore-kang's picture
Upload folder using huggingface_hub
273f88a verified
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