Problem 14. Find the numeric mean of the prime numbers in a matrix.
There will always be at least one prime in the matrix.
Example:
Input in = [ 8 3 5 9 ] Output out is 4 or (3+5)/2
Solution Stats
Problem Comments
-
12 Comments
Show
9 older comments
Mehran Akbari
on 11 Feb 2020
The question topic is hard to understand.
Suraj Kumar
on 26 Jul 2020
Good Problem for beginners.
Leo S
on 30 Nov 2020
What is wrong with
a = find( isprime( in))
out = mean( in( a)) ?
It works perfectly in my own MATLAB environment
Solution Comments
Show commentsProblem Recent Solvers8989
Suggested Problems
-
Make the vector [1 2 3 4 5 6 7 8 9 10]
50123 Solvers
-
Find the alphabetic word product
3373 Solvers
-
1751 Solvers
-
All your base are belong to us
547 Solvers
-
1572 Solvers
More from this Author96
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!