Question: If you can write me some code for MatLab for task 3 and it has to be a function as shown on the images. ENGI
If you can write me some code for MatLab for task 3 and it has to be a function as shown on the images.


ENGI 1331: Mastery Assignment 4 Spring 2021 Resistor Decoder (Application to Electrical and Computer Engineering) Background Comprehension Time: 10 - 15 min Most resistors are so small that the actual value would be too difficult to read if printed on the resistor. Instead, colored bands denote the value of resistance in ohms. Anyone involved in constructing electronic circuits must become familiar with the color code and with practice, one can tell at a glance what value a specific set of colors means. When reading a resistor's color bands: The first two colored bands, pulled from Table 1, represent the first and second digits of the resistance, respectively The third colored band, pulled from Table 2, represents the multiplier applied to the first two digits. For example, if there are three zeros after the first two digits, that would be represented by an orange color as the third colored band. If there are no zeros after the first two digits, that would be represented by a black color as the third colored band. See test cases below for additional examples. Table 1: Color Codes (ColorCode) 3 4 5 7 Orange Yellow Green Grey 8 0 Black 1 Brown 2 Red 6 Blue 9 White Violet 1 Black 10 Brown Table 2: Multipliers (Multiplier) 100 1,000 10,000 Red Orange Yellow 100,000 1,000,000 Green Blue The goal of this program is to convert a given resistance into a set of color bands or convert a given set of color bands into a resistance value. The file, ColorGuide.mat, contains the two above variables necessary to complete this problem. Task 3: (15-20 min) Function 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 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 color names inputted will always match the case sensitivity shown in Tables 1 and 2. Function Inputs: Function Outputs: 1. Color band as a vector, with each color being a 1. The resistance [ohms) corresponding to the separate value in the vector inputted color band 2. The vector, ColorCode (Table 1) 3. The vector, Multiplier (Table 2) ENGI 1331: Mastery Assignment 4 Spring 2021 Resistor Decoder (Application to Electrical and Computer Engineering) Background Comprehension Time: 10 - 15 min Most resistors are so small that the actual value would be too difficult to read if printed on the resistor. Instead, colored bands denote the value of resistance in ohms. Anyone involved in constructing electronic circuits must become familiar with the color code and with practice, one can tell at a glance what value a specific set of colors means. When reading a resistor's color bands: The first two colored bands, pulled from Table 1, represent the first and second digits of the resistance, respectively The third colored band, pulled from Table 2, represents the multiplier applied to the first two digits. For example, if there are three zeros after the first two digits, that would be represented by an orange color as the third colored band. If there are no zeros after the first two digits, that would be represented by a black color as the third colored band. See test cases below for additional examples. Table 1: Color Codes (ColorCode) 3 4 5 7 Orange Yellow Green Grey 8 0 Black 1 Brown 2 Red 6 Blue 9 White Violet 1 Black 10 Brown Table 2: Multipliers (Multiplier) 100 1,000 10,000 Red Orange Yellow 100,000 1,000,000 Green Blue The goal of this program is to convert a given resistance into a set of color bands or convert a given set of color bands into a resistance value. The file, ColorGuide.mat, contains the two above variables necessary to complete this problem. Task 3: (15-20 min) Function 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 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 color names inputted will always match the case sensitivity shown in Tables 1 and 2. Function Inputs: Function Outputs: 1. Color band as a vector, with each color being a 1. The resistance [ohms) corresponding to the separate value in the vector inputted color band 2. The vector, ColorCode (Table 1) 3. The vector, Multiplier (Table 2)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
