Export a Cell as a text file with two delimters

1 回表示 (過去 30 日間)
Roshen Jegajeevan
Roshen Jegajeevan 2021 年 3 月 1 日
回答済み: Allen 2021 年 3 月 1 日
If I have a cell that is called A and I want to export it with two delimiters. A comma and a tab.
For example. In the cell, it would be {1,2,3,4}.
But I want to export it in a text file that says 1, 2, 3, 4,
How would I do this? I already tried strcat and then exporting using a delimiter but it messed up the cell as there are some numerical values in there

回答 (1 件)

Allen
Allen 2021 年 3 月 1 日
Try the following:
% Converts the cell array to a string array, then joins the strings using a comma-tab delimiter
strjoin(string(A),',\t')

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by