フィルターのクリア

separating columns in data files

1 回表示 (過去 30 日間)
Karla Galdamez
Karla Galdamez 2024 年 2 月 6 日
コメント済み: Walter Roberson 2024 年 2 月 6 日
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

回答 (1 件)

Walter Roberson
Walter Roberson 2024 年 2 月 6 日
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 件のコメント
Walter Roberson
Walter Roberson 2024 年 2 月 6 日
Y = readmatrix('Y.txt');
Ypositive = Y(real(Y)>0);
writematrix(Ypositive, 'Ypositive.txt');
dbtype Ypositive.txt 1:10
1 3464.328258+0i 2 0.000674780887635507-0.0611685605125578i 3 0.00285671163585732-0.0454525189854182i 4 0.00421265752004274-0.0361586728286951i 5 0.00516887965437718-0.0294093650495321i 6 0.00573141263822663-0.025892194218674i 7 0.00562182728276639-0.022676055193402i 8 0.00575974729039785-0.0200011190135066i 9 0.00579318668150108-0.0180308127612939i 10 0.0056623294612308-0.0162200839423056i

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeData Import and Analysis についてさらに検索

製品


リリース

R2023b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by