How can I write a matrix into a tab delimited .dat file with header?
显示 更早的评论
Hi,
I would like to ask you the following: I have a matrix (lets call it Output[]) with numbers (integ, decimal and bool) and I want to transform it into a tab delimited .dat file in a format that includes a *header *in the first line and also curly brackets in every row like the following:
Number of Output rows: 240 %this number will be actually assigned by the size of the matrix
{ 102 103 3.5 2.7 1 2.3 } %the spaces are actually tabs
{ 1223 305 8 9 3 0.5 }
{ 507 109 6.5 8.7 2 7.3 }
...and so on
Can somebody help me to do it with fprintf?
Thanks, Iro
采纳的回答
更多回答(1 个)
Iro
2013-5-2
0 个投票
1 个评论
Walter Roberson
2013-5-2
'wt' means you are writing a text file, and is otherwise the same as 'w'.
.' is pure transpose, whereas ' without a dot is conjugate transpose
类别
在 帮助中心 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!