printing a cell matrix to a text file
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Danny Coles
el 8 de Nov. de 2013
Respondida: Danny Coles
el 8 de Nov. de 2013
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 comentarios
Respuesta aceptada
Azzi Abdelmalek
el 8 de Nov. de 2013
Editada: Azzi Abdelmalek
el 8 de Nov. de 2013
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 comentarios
Más respuestas (1)
Ver también
Categorías
Más información sobre Inputs en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!