hello ,this is my file
Hello .. how to read a text file which is a matrix of [1000x512] order of complex numbers. could anyone please help me over this
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Sudeepini
am 8 Feb. 2018
Beantwortet: Sudeepini
am 9 Feb. 2018
I have a file that is matrix of complex numbers with order 1000x512 . I used csvread, textscan to read file . But I am facing problem in reading a file .kindly help me
Akzeptierte Antwort
Jeremy Hughes
am 8 Feb. 2018
Hi Darapu,
This worked for me.
T = readtable('Extracted_Dry_Tar_Road_prediction_file.txt','Whitespace',' ()');
T.Variables
Hope this helps,
Jeremy
0 Kommentare
Weitere Antworten (2)
Birdman
am 8 Feb. 2018
Bearbeitet: Birdman
am 8 Feb. 2018
This does it. The complex numbers are stored in a cell array:
fileID=fopen('Extracted_Dry_Tar_Road_prediction_file.txt','r');
Data=textscan(fileID,'%s');
Data=string(regexprep(Data{1},'[,()]',''));
Data=cellfun(@(x) str2double(x),Data,'uni',0)
fclose(fileID);
which you can reach any of them by typing
Data{1}
Data{2}
and so on.
0 Kommentare
Siehe auch
Kategorien
Mehr zu Data Import and Analysis 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!