separating columns in data files
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
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 Commenti
Risposte (1)
Walter Roberson
il 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 Commento
Walter Roberson
il 6 Feb 2024
Y = readmatrix('Y.txt');
Ypositive = Y(real(Y)>0);
writematrix(Ypositive, 'Ypositive.txt');
dbtype Ypositive.txt 1:10
Vedere anche
Categorie
Scopri di più su Data Import and Analysis in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!