How to write matrix to text with comma separate but first column should be string
3 次查看(过去 30 天)
显示 更早的评论
i have a matrix with four columns. all values are numbers.I want to write it on text with comma separate row by row.but first column should be string after writing.how to do it?please help me. thanks! I used dlmwrite to write and Also I attached a text document with question
0 个评论
回答(1 个)
Ingrid
2014-9-4
You can use sprintf to specify the type of output you want to write (%s for strings and %f for floats) and num2str to convert your number of the first column to a string
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Characters and Strings 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!