my question is after ploting (x,y) , i want to count the number of signals that is above 0.5 at time for example : 1.05e-7, how to do that in matlab
1 回表示 (過去 30 日間)
古いコメントを表示
i want to count the values from data set (:,2:5) that is above 0.5 at specific time
data_1 = load('ay.csv')
x = data_1(:,1)
y = data_1(:,2:5)
plot(x,y)
count=0
n= 17059
m=4
for r=1:n
for c=1:m
if y(r,c)> 0.5 & (x == 1.05e-7)
count= count+1
end
end
end
count
2 件のコメント
Jan
2022 年 9 月 14 日
What is your question?
Does load('ay.csv') work? load works with MAT files and a specific set of text files only.
x is a vector. Then x==1.05e-7 is a vector also. The if condition must be a scalar. Therefore Matlab inserts an all() implicitly. But is this wanted?
Remember that comparisons of floating point numbers are fragile. 1.05e-7 and 1.0499999999e-7 might be displayed as the same value in the command wirndow, but they differ. Using a range is safer.
回答 (1 件)
参考
カテゴリ
Help Center および File Exchange で Large Files and Big Data についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!