How to extract only numbers from this .txt file

19 Ansichten (letzte 30 Tage)
Mike Krause
Mike Krause am 12 Dez. 2020
Kommentiert: Mike Krause am 13 Dez. 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.

Akzeptierte Antwort

Image Analyst
Image Analyst am 13 Dez. 2020
Try this:
fileName = 'ProjectPartATestInput.txt';
allData = readmatrix(fileName)
numbers = allData(:, 2);

Weitere Antworten (0)

Kategorien

Mehr zu File Operations finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by