Read dada from a file
古いコメントを表示
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 件のコメント
Luna
2019 年 7 月 19 日
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
2019 年 7 月 20 日
dan oltean
2019 年 7 月 20 日
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
2019 年 7 月 20 日
Each X,Y,Z,Ts has it's own row.
thank you
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Shifting and Sorting Matrices についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
