Matlab reads file with different order
Mostrar comentarios más antiguos
Hello ,
Can anyone help me as i put into matlab this txt file and it read it like that :
0.9011 0.5400
0.8480 1.4457
0.6744 1.180
thanks in advance
2 comentarios
per isakson
el 31 de Ag. de 2020
How exactly did you read the txt-file?
chntua chntua
el 31 de Ag. de 2020
Respuesta aceptada
Más respuestas (1)
John D'Errico
el 31 de Ag. de 2020
Must I point out the data in that file are arranged as:
data = textread('RQ_par.txt')
data =
0.9011 0.848
0.6744 0.54
1.4457 1.18
MATLAB will read in each line, one at a time. That is how the file is set up.
If you want to change the order to a different order, it is not how you read the file in, but how you perform the re-arrangment.
data = reshape(data',3,2)
data =
0.9011 0.54
0.848 1.4457
0.6744 1.18
1 comentario
chntua chntua
el 31 de Ag. de 2020
Categorías
Más información sobre Low-Level File I/O 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!