problem using textscan: doesnt actually scan anything.
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
hi. I am trying to write a program that reads stuff from a text file. as a simple example, i created a .txt file by the name "niv" that has a row:
1 2 3 4
and want to read it into an array. i tried this:
fopen('C:\Users\Lab\Desktop\niv.txt')
num=textscan('niv.txt','%d')
but afterwards, num is empty.... please help !
thanks .
0 Kommentare
Akzeptierte Antwort
Weitere Antworten (1)
Walter Roberson
am 10 Sep. 2013
You are providing a string 'niv.txt' as the first argument to textscan(). When you provide a string there instead of a file identifier number, it is the content of the string that is scanned rather than the content of the file.
0 Kommentare
Siehe auch
Kategorien
Mehr zu Data Import and Export 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!