Threshold exceedance, where and by how much
3 次查看(过去 30 天)
显示 更早的评论
Hi guys!
I would love your help on this one:
I have an excel file (see attached) which contains daily values of ozone for three stations (A, B, C). For every day I want to check whether any of these three stations exceed the daily threshold oh 100 μg/m3, which station has exceeded the threshold (if any), and by how many digits.
E.g., 01/01/2006, A, 2 μg/m3
Is there a simple way to do this?
Thanks in advance!!
PS. I'm on Matlab 2019
0 个评论
采纳的回答
Steven Lord
2021-6-1
Assuming you're reading this data into a table array like this sample one:
load patients
T = table(LastName, Age, Height, Weight);
head(T)
We can use logical indexing to determine who weighs over 150 pounds.
isOver150 = T.Weight > 150;
patientsOver150 = T(isOver150, :);
head(patientsOver150)
You can see that the first two rows of T are included in patientsOver150 since their weights are 176 and 163 respectively. The next row in patientsOver150 is row 10 of T since rows 3-9 all represent patients with weights under 150. In both cases I'm only showing 10 rows of the tables, which is why the display of patientsOver150 has rows that don't appear in the display of T.
Now to see by how much the patients' weights exceed 150 pounds just compute with that table variable and assign to a new table variable:
patientsOver150.weightOver150 = patientsOver150.Weight - 150;
head(patientsOver150)
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Data Preprocessing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!