[q,nd] = max(10*log10(P)); - this is used in spectrogarm . but can anyone tell me what is this ? and how length of q and nd is calculated?
    2 visualizzazioni (ultimi 30 giorni)
  
       Mostra commenti meno recenti
    
    Biswajit Ojha
 il 19 Lug 2017
  
    
    
    
    
    Commentato: Walter Roberson
      
      
 il 19 Lug 2017
            [q,nd] = max(10*log10(P));
0 Commenti
Risposta accettata
  Star Strider
      
      
 il 19 Lug 2017
        It transforms an argument of power ‘P’ to decibels, and returns in ‘q’ the first instance of the maximum power in decibels, and in ‘nd’ returns the index of that value.
3 Commenti
  Star Strider
      
      
 il 19 Lug 2017
				Why do you say "the value of an array B"? Normally an array is multiple values, not a single value. Did you really mean to say "the values of an array B"?
What are the dimensions of A and B? How does B change in your loop?  Is B a global variable that is declared global both in that routine, and in Sysmodel()??? And you change the value of the global variable B in Sysmodel? If B is declared only in your code you posted, then it will have the same value every time, unless you've intentionally left out critical parts of your code.
  Walter Roberson
      
      
 il 19 Lug 2017
				sz = size(P);
dim = find(sz ~= 1);
sz(dim) = 1;
q and nd will be the size indicated by sz.
If P is a 2D array (not a vector), then q and nd will each be row vectors with as many columns as P had columns.
Più risposte (0)
Vedere anche
Categorie
				Scopri di più su Time-Frequency Analysis in Help Center e File Exchange
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!