I'm plotting ECG data and I want to resale the x and y axis so that only the first 3 seconds are showing
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Inteeskimo
le 7 Nov 2017
Réponse apportée : Star Strider
le 7 Nov 2017
I am a complete beginner so go easy on me :)
load('ecg_wavs.mat') t = linspace(1,3,length(ecg50hz)); subplot(2,1,1); plot(t, ecg50hz), grid on; title('ECG 50Hz'); subplot(2,1,2); plot(t, ecg_emg), grid on; title('ECG EMG');
0 commentaires
Réponse acceptée
Star Strider
le 7 Nov 2017
First, you need to know the sampling frequency of your EKG record. You can either have that stated in the metadata of the record, or from the time vector. If you have the sampling frequency (here ‘Fs’) you can calculate the time vector as:
t = linspace(0, 1, length(ecg50hz))/Fs;
then after your plot call, add:
set(gca, 'XLim',[0 3])
If my assumptions are correct, that will give you the result you want.
NOTE — Since I don’t have your data, this is UNTESTED CODE. It should work.
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Annotations 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!