Export a cell array containing unicode characters in a text file
古いコメントを表示
How to export the following cell array containing the unicode characters U+2191 and U+2193
str={'this ↑ up','this ↓ down'};
in a text file, in such a way that the two arrows will still be visible?
I tried with
str={'this ↑ up','this ↓ down'};
writecell(str','test')
but I got

I also tried with
fid = fopen('temp.txt', 'w');
str = char([2191, 2193]);
encoded_str = unicode2native(str, 'UTF-8');
fwrite(fid, encoded_str, 'uint8');
fclose(fid);
but I got

3 件のコメント
Muhammad Usman
2020 年 4 月 24 日
Change your 2nd line of code as:
str = [char(8592), char(8593), char(8594), char(8595), char(8598), char(8599), char(8600), char(8601)];
I got help from the link given below:
giannit
2020 年 4 月 24 日
Muhammad Usman
2020 年 4 月 24 日
You are most Welcome
回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Environment and Settings についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!