find finite numbers in B using logic indexing ?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Deeksha Veereddy
am 24 Jun. 2021
Beantwortet: millercommamatt
am 24 Jun. 2021
B=[Inf,9,-32,NaN,0,4,67,-Inf,NaN]
using logical indexing :
1.Find the finite numbers in B.
2.Find the sum of finite numbers in B.
0 Kommentare
Akzeptierte Antwort
millercommamatt
am 24 Jun. 2021
B_finite_only = B(isfinite(B));
B_finite_only_sum = sum(B_finite_only);
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Matrix Indexing finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!