How can I import and read a .plt file?
56 views (last 30 days)
Show older comments
I am dealing with .plt files and I need to find a way for matlab to read them and put them in a matrix.
2 Comments
dpb
on 14 Jul 2022
Well, that'll all depend on who wrote the files and what their content/format is...we have no idea where you got these from..
Along with that description, attaching one (use paperclip icon) would be a start.
Accepted Answer
dpb
on 14 Jul 2022
That's essentially trivial since they're just text files -- to upload one, just rename it ".txt" temporarily; what the name is doesn't matter a lick...
data=readmatrix('yourfile.plt','commentstyle','#');
will give you all the data in an array -- you can separate by what appears to be four rows/section.
Or
data=readlines('yourfile.plt');
will leave you with a string array including the comment lines; you can locate those and then convert the sections between to numeric to keep the sections separate.
0 Comments
More Answers (0)
See Also
Categories
Find more on File Operations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!