separating columns in data files
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Hello!
I have a data file, attached. I would like to only obtain the positive values of this file, i.e. only the first column and then make a subsequent text file.
This file is the output of fft on a data file, thus it contains both real values and imaginary values.
Thank you!
Karla
0 Kommentare
Antworten (1)
Walter Roberson
am 6 Feb. 2024
You only have one column of data -- those are complex numbers.
"Only positive" would restrict to just the very first point. Every other point is complex-valued with non-zero imaginary part, and so could not be said to be positive.
1 Kommentar
Walter Roberson
am 6 Feb. 2024
Y = readmatrix('Y.txt');
Ypositive = Y(real(Y)>0);
writematrix(Ypositive, 'Ypositive.txt');
dbtype Ypositive.txt 1:10
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!