필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

Unable to get output of letters from morse code

조회 수: 1 (최근 30일)
Nicholas Mun
Nicholas Mun 2022년 4월 13일
마감: Nicholas Mun 2022년 4월 13일
Im trying to reverse engineer the morse code encoder i made (which is working fine) but i ran into two problems
morsecode = {'.-','-...','-.-.','-..','.','..-.','--.','....','..','.---','-.-','.-..', ...
'--','-.','---','.--.','--.-','.-.','...','-','..-','...-','.--','-..-', ...
'-.--','--..'};
letter = char('A':'Z');
userinput = strjoin(strsplit(userinput, ' '));
for i = 1:length(userinput)
[~, index] = ismember(userinput(i), morsecode);
if index > 0
moutput = [moutput ' ' letter{i}]
end
end
set(handles.morse, 'String' , moutput);
in this example the letter{i} is the part which an error occurs, and when i change it to () instead of {} an output comes out, but its just A B C D E F G.....Z regardless of the morsecode input i enter....may i know if there is a problem wiht my logic? thanks

답변 (0개)

이 질문은 마감되었습니다.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by