行列が与えられたときに、その行列内の素数の平均を計算する関数を作成しましょう。
例:
入力の行列が in = [ 8 3 5 9 ] のとき、 出力が 4 あるいは (3+5)/2 のようになります。
- (英語版) Problem 14. Find the numeric mean of the prime numbers in a matrix. https://www.mathworks.com/matlabcentral/cody/problems/14
Solution Stats
Problem Comments
Solution Comments
Show comments
Loading...
Problem Recent Solvers353
Suggested Problems
-
Numbers with prime factors 2, 3 and 5.
683 Solvers
-
Return unique values without sorting
1019 Solvers
-
Compute a dot product of two vectors x and y
1056 Solvers
-
Split a string into chunks of specified length
2137 Solvers
-
Check that number is whole number
5437 Solvers
More from this Author12
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!