Question: Develop a user-defined function named Color2Resist to convert a color band to its corresponding resistance [ohms]. Assume that the color band has been formatted in
Develop a user-defined function namedColor2Resistto convert a color band to its corresponding resistance [ohms]. Assume that the color band has been formatted in the form of a vector, where every color is a different element in the vector. Determine the corresponding resistance [ohms] using Tables 1 and 2. You may assume that the colors inputted will always match the case sensitivity shown in Tables 1 and 2.
Function Inputs:
- Color band as a vector, with each color being a separate value in the vector
- The vector,ColorCode(Table 1)
- The vector,Multiplier(Table 2)
Checkpoint
Function Outputs:
1. Resistance [ohms] corresponding to the inputted color band, as a vector with each digit being a separate value in the vector
The function header should be formatted similarly to the following:
function[out1] = Color2Resist (in1, in2, in3)
ColorCode:
Columns 1 through 7
"Black" "Brown" "Red" "Orange" "Yellow" "Green" "Blue"
Columns 8 through 10
"Violet" "Grey" "White"
Multiplier:
"Black" "Brown" "Red" "Orange" "Yellow" "Green" "Blue"
multiplier and color code are the data provided
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
