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 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Carolina MV
el 28 de Dic. de 2017
Comentada: Carolina MV
el 28 de Dic. de 2017
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
2 comentarios
Respuesta aceptada
Image Analyst
el 28 de Dic. de 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.
Más respuestas (0)
Ver también
Categorías
Más información sobre MATLAB Report Generator en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
