printing a cell matrix to a text file
1 次查看(过去 30 天)
显示 更早的评论
Hi,
I have a 9 x 4 cell matrix, called C, the first and last columns have text, the other 2 columns have numbers, as shown below:
C =
'har( ' [0.5189] [252.3755] 'true'
'har( ' [0.1816] [289.4976] 'true'
'har( ' [0.1015] [231.4329] 'true'
'har( ' [0.0523] [269.8641] 'true'
'har( ' [0.0454] [128.8302] 'true'
'har( ' [0.0451] [121.8095] 'true'
'har( ' [0.0149] [140.7870] 'true'
'har( ' [0.0124] [271.3026] 'true'
'har( ' [0.0069] [ 88.0826] 'true'
I would like to send this to a text file for use elsewhere, please can you help.
Also, I would like to remove the quotation marks on the text and the square brackets for the numbers when if appears in the text file if possible.
Cheers
Danny
0 个评论
采纳的回答
Azzi Abdelmalek
2013-11-8
编辑:Azzi Abdelmalek
2013-11-8
fid=fopen('filename.txt','w')
for k=1:size(C,1)
fprintf(fid,'%s %d %d %s\r\n',C{k,:})
end
fclose(fid)
0 个评论
更多回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Inputs 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!