How to extract only numbers from this .txt file

20 vues (au cours des 30 derniers jours)
Mike Krause
Mike Krause le 12 Déc 2020
Commenté : Mike Krause le 13 Déc 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.

Réponse acceptée

Image Analyst
Image Analyst le 13 Déc 2020
Try this:
fileName = 'ProjectPartATestInput.txt';
allData = readmatrix(fileName)
numbers = allData(:, 2);

Plus de réponses (0)

Catégories

En savoir plus sur File Operations dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by