This code says 'Index exceeds matrix dimensions' error help!
情報
この質問は閉じられています。 編集または回答するには再度開いてください。
古いコメントを表示
function braille = convertToBraille(letter)
global brailleTable
global x
x = [];
braille = double(letter);
for i = 1: length(letter)
if braille(i) == 97
x = brailleTable(1:3,1:2); %LINE 10
elseif braille(i) == 98
x= brailleTable(1:3,3:4);
elseif braille(i) == 99
x = brailleTable(1:3,4:6);
elseif braille(i) == 100
x = brailleTable(1:3,5:8);
end
braille(i) = x;
end
I am trying to create converting alphabet to braille code.
it says Index exceeds matrix dimensions. at line 10
0 件のコメント
回答 (1 件)
Walter Roberson
2017 年 11 月 26 日
0 投票
You did not initialize brailleTable in the global workspace before you called the function. A global variable that has not been initialized after being declared global, will have value []
0 件のコメント
この質問は閉じられています。
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!