Answered step by step
Verified Expert Solution
Question
1 Approved Answer
need help with this function in matlab Task 3: Function - Determine the resistance in ohms - Create a new function named Color2Resist.m that will
need help with this function in matlab
Task 3: Function - Determine the resistance in ohms - Create a new function named Color2Resist.m that will convert a set of color bands to a numerical resistance in [ohms] Inputs: (1) 13 string vector that contains the corresponding color bands in order. You may assume the text capitalization will always match the information provided in the ColorCode and Multipliers variables. Example Input: C=[ "Brown" "Black" "Red"] Outputs (1) Numerical value for resistance in [ohms] as a regular number (not a vector!) - Use the information provided in the ColorCode and Multipliers variables to determine the corresponding resistance for the color bands. The last page of this guide provides a reference example! HINT: Pay careful attention to indexing! HINT: Load the ColorGuide.mat file inside your function so that you can use the ColorCode and Multipliers variables inside your function. Test Case 1: Color Band = ["Red" "Yellow" "Orange"] 0%(34%) Variable StudentOutput has an incorrect value. Incorrect resistance. Utilize the data in ColorCode and Multiplier to convert the color band to a resistance. ColorCode should be used for the first colors in the color band. Multiplier should be used for the third color. Notice how, for example, "Red" is the third color in the ColorCode, but the value that corresponds to it is 2 , not 3. Test Case 2: Color Band = ["Grey" "Grey" "Yellow"] 0%(33%) Variable StudentOutput has an incorrect value. Incorrect resistance. Utilize the data in ColorCode and Multiplier to convert the color band to a resistance. ColorCode should be used for the first colors in the color band. Multiplier should be used for the third color. Notice how, for example, "Red" is the third color in the ColorCode, but the value that corresponds to it is 2 , not 3. Test Case 3: Color Band = ["Grey" "Grey" "Black"] 0%(33%) Variable StudentOutput has an incorrect value. Incorrect resistance. Utilize the data in ColorCode and Multiplier to convert the color band to a resistance. ColorCode should be used for the first colors in the color band. Multiplier should be used for the third color. Notice how, for example, "Red" is the third color in the ColorCode, but the value that corresponds to it is 2 , not 3Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started