how read array from a text file??
Ältere Kommentare anzeigen
Hello
I have a text file having data like:-
12 23 24
45 66 99
11 22 33
these are in array form and
i want to read these array values as we generally access array values like
for example- i get the first row in a variable say- A i.e
A = 12 23 24
and on accessing A(1) it will give ans-12
so i want read this way.
Any help will be appreciated.
Thanks
Ashish
Antworten (2)
Andrei Bobrov
am 17 Mai 2012
A = dlmread('nametextfile.txt')
2 Kommentare
Ashi
am 18 Mai 2012
Walter Roberson
am 18 Mai 2012
A(:,1), A(:,2) and so on.
Or transpose the result you get from dlmread()
Ziraddin Gulumjanly
am 19 Mai 2022
12 34 82
23 54 22
34 92 29
45 91 21
67 63 12
45 43 77
43 12 75
Kategorien
Mehr zu Cell Arrays finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!