Question: Matlab code: Create a function called colorbars that has no inputs and two outputs. The first output will be a 4x6x3 matrix called RGB which
Matlab code:


Create a function called colorbars that has no inputs and two outputs. The first output will be a 4x6x3 matrix called RGB which will represent an rgb image. Each column of the image will be a single color, in rainbow order. Experiment with different combinations of R, G and B to get the image colors right (Hint: all the values in this image are either 0 or 1, except in the orange row where one of the three components is set to 0.5). With correct values for RGB, the image should look like the following (enlarged for visibility): The second output to the function will be a 6x3 matrix called colors. Each row of colors wll contain the (r, g, b) value corresponding to the colors red, orange, yellow, green, blue, and magenta IN THAT ORDER. Use the Mathworks documentation for reference: https://www.mathworks.com/help/matlab/ref/colorspec.html
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
