Convert a 3 element RGB array to its correspoding grayscale pixel (a scalar)
*Hint: a formula exists!
Solution Stats
Problem Comments
1 Comment
Solution Comments
Show comments
Loading...
Problem Recent Solvers29
Suggested Problems
-
Determine whether a vector is monotonically increasing
23531 Solvers
-
Find all elements less than 0 or greater than 10 and replace them with NaN
15819 Solvers
-
Back to basics 11 - Max Integer
812 Solvers
-
85 Solvers
-
Double all elements in the array
2412 Solvers
More from this Author4
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
I believe one of the paretheses is misplaced in each of the assert statements. They should be assert(abs(RGB_to_gray(x)-g) < 1e-2).