How to change a sound in a specific condition
조회 수: 2 (최근 30일)
이전 댓글 표시
while 1
brain=fread(bt)
if (100<brain) && ( brain<150)
disp ( 'attention')
elseif .....condition goes here
disp('meditation')
end
end
댓글 수: 1
KSSV
2018년 11월 29일
YOu have to finish your first question and then ask the second one.....theere is no discussion/ response from you on your first question and you have more or less asked a same question.
채택된 답변
Walter Roberson
2018년 11월 29일
conditions_list = {'?', 'attention', 'meditation'};
while 1
brain=fread(bt);
if isempty(brain); break; end
mask1 = (100<brain) & ( brain<150);
mask2 = second_test_goes_here
condition = ones(size(brain));
condition(mask1) = 2;
condition(mask2) = 3;
brain_conditions = conditions_list(condition);
disp( strjoin(brain_conditions, ' '));
end
댓글 수: 0
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!