How can I write any cell data into txt file as they appear.
Mostrar comentarios más antiguos
for example;
data= { 'a' 1 2 3 ; 'b' 4 5 6 }
startingFolder = 'C:\Program Files\MATLAB'
if ~exist(startingFolder, 'dir')
startingFolder = pwd
end
defaultFileName = fullfile(startingFolder, '*.txt')
[baseFileName, folder] = uiputfile(defaultFileName, 'Select a file')
if baseFileName == 0
return
end
fullFileName = fullfile(folder, baseFileName)
fid = fopen(fullFileName, 'wt')
fwrite(fid, data) %error using fwrite Cannot write value: unsupported class cell
fclose(fid)
I wanna write numbers as ASCII format with characters. like;
a 1 2 3
b 4 5 6
Respuesta aceptada
Más respuestas (1)
David Sanchez
el 29 de Mayo de 2013
0 votos
you should follow the link above:
It provides a m-file to write cells to txt
Categorías
Más información sobre String Parsing en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!