Question: MATLAB Problem 6: Write a function rgb.color.m to display color (red, green, blue, yellow, a genta, cyan, white) as a result of mixing primary colors

MATLAB  MATLAB Problem 6: Write a function rgb.color.m to display color (red,

Problem 6: Write a function rgb.color.m to display color (red, green, blue, yellow, a genta, cyan, white) as a result of mixing primary colors (red, green, blue). The function should have the following header: function color = rgb-color(rgb) where the input rgb is a 3-element vector having value of either 0 or to denote the three primary colors (red green, blue) respectively. The output color is a string denoting the color of the mixture. See http://en.wikipedia.org/wiki/Additive color for information on how colors are mixed. For example, when rgb = [10 0], the resulting color is red. When rgb = [11 11, the resulting color is white. If the input rgb is not a valid input, the output color should be the string Invalid input'. Remember to give the function a description. Use nested if statements. (a) Set p6a=evalc('help rgb-color'). (b) Set p6b-rgb color) (c) Set p6c=rgb-color(10 0). (d) Set p6d=rgb-color(01 0) (e) Set pie=rgb color([001]) (f) Set p6f=rgb.color([10 1]) (g) Set p65-rgb-color(0 1 1]) (h) Set p6h=rgb.color(1 1 0]). (i) Set p61=rgb-color(0 0 0)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!