Reading values from a text file and converting to array.
Mostrar comentarios más antiguos
I have a text file 'U.txt' which has data as follows:
# x 0 0.3 0.4
# y 0 0 0
# z 0 0 0
# Time
0.000125 (0.101993 0 0) (0.100009 0 0) (0.100009 0 0)
0.00025 (0.14199 0 0) (0.0998676 0 0) (0.0976896 0 0)
0.000375 (0.161106 0 0) (0.0989464 0 0) (0.0895835 0 0)
0.0005 (0.178717 0 0) (0.0960872 0 0) (0.0763535 0 0)
I want to extract the values of each column (without the header) into respective arrays.example:
Array1= 0.000125 0.00025 0.000375 0.0005
Array2= 0.101993 0.14199 0.161106 0.178717
Array3= 0.100009 0.0998676 0.0989464 0.096872
Array4= 0.100009 0.0976896 0.0895835 0.0763535
Kindly help me out. Thanks in advance
1 comentario
rifat
el 28 de Mayo de 2014
could you please attach the text file?
Respuesta aceptada
Más respuestas (1)
Pedro Rodenas
el 11 de Jun. de 2017
0 votos
Thank you very much!
Categorías
Más información sobre Text Files 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!