I have a matrix which looks like A = [1 NaN 1 ; NaN 1 2; NaN 1 2]; How can I remove all NaN's from the A matrix?
8 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Rubel Ahmed
il 7 Nov 2018
Commentato: madhan ravi
il 7 Nov 2018
A = [1 NaN 1 ; NaN 1 2; NaN 1 2];
0 Commenti
Risposta accettata
madhan ravi
il 7 Nov 2018
Modificato: madhan ravi
il 7 Nov 2018
A = [1 NaN 1 ; NaN 1 2; NaN 1 2];
A(isnan(A))=[] ;
A = reshape(A,3,2)
command window:
>> COMMUNITY
A =
1 1
1 2
1 2
>>
4 Commenti
madhan ravi
il 7 Nov 2018
B = [1 NaN, NaN,3,1;1 NaN, 1,NaN,1;1 NaN, 1,NaN,1;1 NaN, NaN,NaN,1;1 NaN, 2,NaN,1]
B(isnan(B))=[]
a=factor(numel(B));
m = max(a);
n=min(a);
reshape(B,m,n)
Più risposte (2)
Vedere anche
Categorie
Scopri di più su Logical 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!