HKQuantity

版本 1.0.0 (4.7 KB) 作者: Robert Schmidt
Extracts quantity values from the Apple Health export.xml file
44.0 次下载
更新时间 2022/10/17

查看许可证

Wearable health sensors opened the possibilty of continuously monitoring vital signs, by now the first adopters of smart watches have years of data at their disposal. At the same time, smartphones started to track the activity and distances that the owner walked. By now also third-party apps save their data into the Apple Health app, making it the most complete record that is accessible.
However, interpreting these large datasets on the phone to find correlations, trends, extremes, etc. is not optimal yet, or non-existent. MATLAB is made to perform complex smoothing, calculation, trend explorations of large datasets and can display them in beautiful graphs either for medical publications or personal use.
From the following categories are covered by the HKQuantity function: Activity, Body Measurements, Reproductive Health, Hearing, Vital Signs, Lab and Test Results, Nutrition, Alcohol, Consumption, Mobility, or UV Exposure.
The HKQuantity function includes an automatic suggestion and completion feature for the input names as well as code examples.
Loading the Apple Health data into MATLAB
Unzip the Apple Health "export.zip", in MATLAB select the now unzipped folder as 'Current Folder'. It should contain a file called "export.xml". Copy the following code to your matlab script to import the dataset in a cell vector.
Data = import('export.xml');
HKQuantity variables
The following quantity values can be exctracted if they are present in the dataset: 'StepCount','DistanceWalkingRunning','GroundContactTime','RunningPower','RunningSpeed','RunningStrideLength','RunningVerticalOscillation','DistanceCycling','PushCount','DistanceWheelchair','SwimmingStrokeCount','DistanceSwimming','DistanceDownhillSnowSports','BasalEnergyBurned','ActiveEnergyBurned','FlightsClimbed','NikeFuel','AppleExerciseTime','AppleStandTime','VO2Max','Height','BodyMass','BodyMassIndex','LeanBodyMass','BodyFatPercentage','Circumference','BasalBodyTemperature','EnvironmentalAudioExposure','HeadphoneAudioExposure','HeartRate','RestingHeartRate','WalkingHeartRateAverage','HeartRateVariabilitySDNN','OxygenSaturation','BodyTemperature','BloodPressureDiastolic','BloodPressureSystolic','RespiratoryRate','BloodGlucose','ElectrodermalActivity','ForcedExpiratoryVolume1','ForcedVitalCapacity','InhalerUsage','InsulinDelivery','NumberOfTimesFallen','PeakExpiratoryFlowRate','PeripheralPerfusionIndex','DietaryBiotin','DietaryCaffeine','DietaryCalcium','DietaryCarbohydrates','DietaryChloride','DietaryCholesterol','DietaryChromium','DietaryCopper','DietaryEnergyConsumed','DietaryFatMonounsaturated','DietaryFatPolyunsaturated','DietaryFatSaturated','DietaryFatTotal','DietaryFiber','DietaryFolate','DietaryIodine','DietaryIron','DietaryMagnesium','DietaryManganese','DietaryMolybdenum','DietaryNiacin','DietaryPantothenicAcid','DietaryPhosphorus','DietaryPotassium','DietaryProtein','DietaryRiboflavin','DietarySelenium','DietarySodium','DietarySugar','DietaryThiamin','DietaryVitaminA','DietaryVitaminB12','DietaryVitaminB6','DietaryVitaminC','DietaryVitaminD','DietaryVitaminE','DietaryVitaminK','DietaryWater','DietaryZinc','BloodAlcoholContent','NumberOfAlcoholicBeverages','AppleWalkingSteadiness','SixMinuteWalkTestDistance','WalkingSpeed','WalkingStepLength','WalkingAsymmetryPercentage','WalkingDoubleSupportPercentage','StairAscentSpeed','StairDescentSpeed', and 'UVExposure'.
Important: Keep the 'functionSignatures.json' file in the same folder as the HKQuantity function, for the automatic function suggestion and completion. Please cite me if you use my code for publications!

引用格式

Robert Schmidt (2024). HKQuantity (https://www.mathworks.com/matlabcentral/fileexchange/119188-hkquantity), MATLAB Central File Exchange. 检索来源 .

MATLAB 版本兼容性
创建方式 R2021b
与 R2021b 及更高版本兼容
平台兼容性
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!
版本 已发布 发行说明
1.0.0