Cody

Problem 2542. Convert a grayscale image into RGB colour format, preserving data type

Solution 498235

Submitted on 10 Sep 2014 by Matt Wolinsky
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Pass
%% grayImage = [1 2 3; 4 5 6; 7 8 9]; rgbImage(:,:,1) = [1 2 3; 4 5 6; 7 8 9]; rgbImage(:,:,2) = [1 2 3; 4 5 6; 7 8 9]; rgbImage(:,:,3) = [1 2 3; 4 5 6; 7 8 9]; assert(isequal(gray2rgb(grayImage),rgbImage))

Suggested Problems

Community Treasure Hunt

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

Start Hunting!