find finite numbers in B using logic indexing ?

1 vue (au cours des 30 derniers jours)
Deeksha Veereddy
Deeksha Veereddy le 24 Juin 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.

Réponse acceptée

millercommamatt
millercommamatt le 24 Juin 2021
B_finite_only = B(isfinite(B));
B_finite_only_sum = sum(B_finite_only);

Plus de réponses (0)

Catégories

En savoir plus sur Matrix Indexing dans Help Center et File Exchange

Produits


Version

R2014a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by