for loop that will iterate through the integers from 32 to 255. show the corresponding character from the character encoding
4 次查看(过去 30 天)
显示 更早的评论
how do i write a script for a loop that will iterate through the integers from 32 to 255 and show the corresponding character from the character encoding
0 个评论
回答(2 个)
Tim Jackman
2015-9-16
Loop through and display each corresponding ASCII character? So something like this?
for ii = 32:255
disp(char(ii))
charact(ii-31) = char(ii);
end
Stephen23
2015-9-16
编辑:Stephen23
2015-9-17
Like most MATLAB code it is easier and faster without a loop:
>> char(32:255)
ans =
!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ ¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Loops and Conditional Statements 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!