The summation of elements between two numbers
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
We have made a matrix with 7 rows and 18 columns with random elements between 10-100. From these we have solved that there are 21 elements with a value between 35 and 55.
Now we have to calculate the summation of these 21 elements. How do we do that?

0 Commenti
Risposta accettata
David Hill
il 20 Nov 2022
yourMatrix=rand(7,18)*90+10;
s=sum(yourMatrix(yourMatrix>=35&yourMatrix<=55))
0 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Number Theory 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!