Some problems with “writematrix” function。
1 回表示 (過去 30 日間)
古いコメントを表示
I want to not write double quotes when using the “writematrix” function to write a character matrix to txt.
Can you help me?

1 件のコメント
Stephen23
2025 年 4 月 29 日
編集済み: Stephen23
2025 年 4 月 29 日
Lets try it now with a character matrix:
A = ['0110';'1010'];
writematrix(A,'test.txt')
type test.txt
No double quotes added.
Lets try a string array:
A = ["0110";"1010"];
writematrix(A,'test.txt')
type test.txt
No double quotes added.
What does reproduce your screenshot is when the data itself contains trailing commas (i.e. field delimiters):
A = ['0110,';'1010,'];
writematrix(A,'test.txt')
type test.txt
Solution: remove the trailing commas from the data OR specify the QuoteStrings option:
A = ['0110,';'1010,'];
writematrix(A,'test.txt', "QuoteStrings","none")
type test.txt
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Standard File Formats についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!