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 vues (au cours des 30 derniers jours)
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

Réponse acceptée

Image Analyst
Image Analyst le 28 Déc 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.

Plus de réponses (0)

Catégories

En savoir plus sur MATLAB Report Generator dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by