Read Data from Text File as Matrix

2 vues (au cours des 30 derniers jours)
Rounak Saha Niloy
Rounak Saha Niloy le 15 Mar 2022
Modifié(e) : Arif Hoq le 15 Mar 2022
I have a text file with name "1.txt". The Content of the file is as follows-
1.20
2.30
3.50
4.88
I want to read the text file and get it as-
X = [1.20 2.30 3.50 4.88]
How do I do this?

Réponse acceptée

Arif Hoq
Arif Hoq le 15 Mar 2022
Modifié(e) : Arif Hoq le 15 Mar 2022
a=readmatrix('1.txt');
X=a'

Plus de réponses (0)

Catégories

En savoir plus sur Standard File Formats dans Help Center et File Exchange

Tags

Produits


Version

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by