How to extract only numbers from this .txt file
19 次查看(过去 30 天)
显示 更早的评论
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.
采纳的回答
Image Analyst
2020-12-13
Try this:
fileName = 'ProjectPartATestInput.txt';
allData = readmatrix(fileName)
numbers = allData(:, 2);
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 File Operations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!