How to cite only part of a vector in an equation?
1 回表示 (過去 30 日間)
古いコメントを表示
Hi,
I am working on a health study. I have the daily contaminant levels in grinking water, for a month long period, for three different communities. I am trying to tabulate people's exposure based on how long they drank the water. So, if JaneDoe lived in Town A from 1/1/12-1/5/12 and then lived in Town B from 1/6/12-1/31/12, her level of exposure would be....
The question is how do I cite only part of a vector based on a date range? This is a population study of several thousand people so I can't manually call the date ranges for each participant in the study... The code would be something along the lines of:
if town=TownA,
then ....cite this part of TownA's contaminant vector, but on ly for the date range in wich JaneDoe lived there....the muchy part I don't know how to code:[
Thanks for any thoughts on this!
0 件のコメント
回答 (1 件)
Stephan
2020 年 12 月 8 日
One possible way:
You could use findgroups in combination with splitapply. For example, a JaneDoe group would be a member of the corresponding group regardless of the cities in which they were staying, and a function can be applied to these group members so that it is comparatively easy to obtain this information.
An example for understanding can be found here: https://de.mathworks.com/help/matlab/ref/findgroups.html#buxwasl
Another possible way:
0 件のコメント
参考
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!