Read dada from a file
Mostrar comentarios más antiguos
So, I have an input text file(.txt) looking something like this: X:0.34, y:0.45, z:0.32, t:0.002
How can I read each variable separately like a column for x, one for y... and store them into matlab?
7 comentarios
Luna
el 19 de Jul. de 2019
Could you please share your .txt file to see how it is structured?
1) are the 2 colons that follow 't' intentional?
2) are the data listed in columns like this
X:0.34, y:0.45, z:0.32, t::0.002
X:0.34, y:0.45, z:0.32, t::0.002
X:0.34, y:0.45, z:0.32, t::0.002
X:0.34, y:0.45, z:0.32, t::0.002
X:0.34, y:0.45, z:0.32, t::0.002
X:0.34, y:0.45, z:0.32, t::0.002
I agree with Luna that attaching an example txt fill will save a lot of time and increase the precision to the answer that you need.
dan oltean
el 20 de Jul. de 2019
dan oltean
el 20 de Jul. de 2019
We can work with that! In the image you shared earlier, each set of x:... Y:... Z:... Ts:... has it's own row. But in the text you shared above, it looks like there can be multiple X,Y,Z,Ts per line. In fact, there are no line breaks in the text you shared so all of that is on 1 line. These details are important to set straight before designing a solution.
Tudor Oltean
el 20 de Jul. de 2019
Each X,Y,Z,Ts has it's own row.
thank you
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Shifting and Sorting Matrices 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!
