I want to use this if statemant to find if the heartrate values in the file attatched are superior to 100, but it it not working

3 views (last 30 days)
This is the code i used with the table 'dia5' as person file: A=input('Person File');
hr=A{:,{'heartrate'}};
T=A{:,{'temperature'}};
t=A{:,{'time'}};
if (hr>100)
disp('stress')
end

Accepted Answer

Image Analyst
Image Analyst on 28 Dec 2017
This works
filename = 'dia5.mat';
s = load(filename)
A = s.A;
hr=A{:,{'heartrate'}};
T=A{:,{'temperature'}};
t=A{:,{'time'}};
for row = 1 : length(hr)
if (hr(row) > 100)
fprintf('Stressed at time %s with heart rate of %d and temperature of %f\n', ...
t(row), hr(row), T(row));
end
end
but I'm not sure what you're after.

More Answers (0)

Categories

Find more on MATLAB Report Generator in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!