I need to find Y values between two given points.
    2 vues (au cours des 30 derniers jours)
  
       Afficher commentaires plus anciens
    
    Inteeskimo
 le 11 Nov 2017
  
    
    
    
    
    Réponse apportée : the cyclist
      
      
 le 11 Nov 2017
            I have sets of x coordinates as follows (1527 2127, 2629 3229,...etc)
I need to find the Y values between each set then take all of those values and divide it by the number of sets.
This is an ECG signal and basically, I want to make a new plot which is an average of each cycle.
4 commentaires
  the cyclist
      
      
 le 11 Nov 2017
				Is x stored in a 10,000 x 2 array? Are the intervals defined by each row of x guaranteed to be disjoint from each other, with no overlap?
Réponse acceptée
  the cyclist
      
      
 le 11 Nov 2017
        Here is a small-scale example.
x = [1527 2127;
     2629 3229;
     4131 5555];
y = [2000;
     2100;
     3000;
     3100;
     5000];
y3 = reshape(y,1,1,[]);
intervalIndex3 = y3 > x(:,1) & y3 < x(:,2);
[intervalIndex,~,~] = ind2sub([size(x,1) 1 size(y,1)],find(intervalIndex3))
intervalIndex will tell you which row of x the value of y belongs to.
0 commentaires
Plus de réponses (0)
Voir également
Catégories
				En savoir plus sur Detection, Range and Doppler Estimation 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!


