Searching a cell array of percentile scores based on age and gender
显示 更早的评论
I have one table in matlab and two cell arrays. The table is a list of ID numbers, age, sex, and test scores. The second two cell arrays are percentile rankings, one table for males and the other for females. What I am trying to do first is use the sex to select the correct percentile rankings array. Then, using the age, find the correct column. The ages are located in row 1. Then within that column find the matching score. Once the matching score is found the percentile ranking is in the first column for that row.
This is an example of the Subject table
PartID Age Sex Test
_______ ____ ___ __________
'Y01' 19 1 ''
'Y02' 22 1 '58.39'
'Y03' 21 1 '61.28'
'Y04' NaN NaN ''
'Y05' 19 1 '63.55'
This is an example of the male percentile table. Ages are in Row 1 and percentile rankings are Column 1. The inside of the array is the test scores.
'Males' [ 19] [ 20] [ 21] [ 22]
[ 97] [63.5500] [ 63] [62.4500] [61.9000]
[ 96] [62.3700] [61.8300] [61.2800] [60.7400]
[ 95] [61.1800] [60.6500] [60.1100] [59.5700]
[ 94] [59.9800] [59.4500] [58.9200] [58.3900]
For subject Y02 it would determine they had a percentile of 94. Y03 would be 96. Y05 would be 97. Then any subject with a missing value would be skipped.
Any suggestions on how to accomplish this?
Thank you
采纳的回答
更多回答(1 个)
Katarzyna Wieciorek
2015-5-29
0 个投票
类别
在 帮助中心 和 File Exchange 中查找有关 Fit Postprocessing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!