フィルターのクリア

delete the new line character at the end when using dlmwrite

2 ビュー (過去 30 日間)
Efe Berkay Yitim
Efe Berkay Yitim 2023 年 1 月 19 日
回答済み: Walter Roberson 2023 年 1 月 19 日
I have a binary matrix m by n (which contains either 0 or 1) and I want to write each column as a string to a file without any delimiter between characters. So, I have used
dlmwrite(file_name, A(:,i)', 'delimiter', '', '-append')
in a for loop. However, it appends a new line character after each write. How can I overcome this issue?
Thanks.

回答 (1 件)

Walter Roberson
Walter Roberson 2023 年 1 月 19 日
You cannot. Give up on using dlmwrite in a loop for that purpose.
If you are looping over all columns and not writing additional information then
dlmwrite(filename, A(:).', 'delimiter', '')
with no loop.

カテゴリ

Help Center および File ExchangeCharacters and Strings についてさらに検索

製品


リリース

R2022b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by