10x10x15 matrix integration.
    4 vues (au cours des 30 derniers jours)
  
       Afficher commentaires plus anciens
    
    Özgür Alaydin
 le 17 Sep 2021
  
    
    
    
    
    Réponse apportée : Star Strider
      
      
 le 17 Sep 2021
            Dear All
I have data composes of A=10x10x15 matrix (attached). I want to integrate this data over X and Y axis. Each axis is also 10x10x15 matrix (attached data). How to do it?
Equation is integral of A.*X.*Y.*A over X and Y. 
Thanks a lot
0 commentaires
Réponse acceptée
  Star Strider
      
      
 le 17 Sep 2021
        What are ‘X and Y axis’?  
AXY = A.*X.*Y.*A;
Xint = trapz(AXY,1);                                    % Integrate Columns (Dimension 1)
Yint = trapz(AXY,2);                                    % Integrate Rows (Dimension 2)
Xintsq = squeeze(Xint)
Yintsq = squeeze(Yint)
This gives ‘Xint’ as a (1x10x15) matrix and ‘Yint’ as a (10x1x15) matrix.  After the squeeze calls, they are both (10x15) matrices.  
Alternatively, do successive integrations: 
XYint = trapz(Xint);
producing a (1x15) vector.  
Experiment with this approach to get the result you want (since I have absolutely no idea what that is).  
.
0 commentaires
Plus de réponses (0)
Voir également
Catégories
				En savoir plus sur Numerical Integration and Differentiation 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!

