MATLAB: 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

heartif statementmedicaltable

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

Best Answer

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.