How to avoid or delete Nan values in addtion?
    1 visualizzazione (ultimi 30 giorni)
  
       Mostra commenti meno recenti
    
    Shubham Mohan Tatpalliwar
 il 10 Ott 2018
  
    
    
    
    
    Modificato: Guillaume
      
      
 il 10 Ott 2018
            if i have2 matrix
A=[2 NaN ; 3 NaN]  
B=[NaN 4 ; NaN 5]
I want C as
[2  4 ; 3 5 ]
edited by guillaume: Nan is not valid in matlab. NaN or nan is.
0 Commenti
Risposta accettata
  madhan ravi
      
      
 il 10 Ott 2018
        
      Modificato: madhan ravi
      
      
 il 10 Ott 2018
  
      A=[2 NaN ; 3 NaN]  %Edited
B=[NaN 4 ; NaN 5]
A(isnan(A))=0
B(isnan(B))=0
C=[A;B]'
3 Commenti
Più risposte (1)
Vedere anche
Categorie
				Scopri di più su Operators and Elementary Operations 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!