fprintf for character above 127 uses 3 bytes
Show older comments
Hello Everyone, could somebody give me a hint why apply fprintf to a character beyond 127 would result a consumption of 3 bytes? Is this related to Matlab or the system? Thank you in advance.
Here is my test code, and further below is part of the results I got out of this code:
fid=fopen('testprintbeyond128','w')
for i=1:255
fprintf(fid,'%s\t',num2str(i));
fprintf(fid,'%s\t',dec2hex(i));
cc=fprintf(fid,'%s\t',char(i));
fprintf(fid,'%d\n',cc)
end
fclose(fid)
results:
123 7B { 2
124 7C | 2
125 7D } 2
126 7E ~ 2
127 7F 2
128 80 3
129 81 3
130 82 3
Accepted Answer
More Answers (0)
Categories
Find more on Characters and Strings in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!