How to extract only numbers from this .txt file
18 views (last 30 days)
Show older comments
Mike Krause
on 12 Dec 2020
Commented: Mike Krause
on 13 Dec 2020
I am trying to take only the numbers from this file and put them into a column vector but I can't seem to get Matlab to read around the wording. I'm assuming that it should be fairly simple, but since i cant change the formatting of the .txt file that will be used I am a bit stuck.
Accepted Answer
Image Analyst
on 13 Dec 2020
Try this:
fileName = 'ProjectPartATestInput.txt';
allData = readmatrix(fileName)
numbers = allData(:, 2);
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!