assigning value to character and that value is assigned in the pattern
2 次查看(过去 30 天)
显示 更早的评论
sir,i have defined a pattern['00100101';'10100100'] and an character array chars{'a','b'}; if i give the input character as 'a' then it should be assigned as '00100101'.sir could you help me how to write the code for it.
2 个评论
采纳的回答
Walter Roberson
2013-12-24
pats = {'00100101';'10100100'};
this_char = 'a';
pats{this_char - 'a' + 1}
0 个评论
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!