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. function [resistance] = Color2Resist(colorBands) \% Purpose: Converts a vector of color bands to the corresponding resistance. % % Input: % colorBands =13 string vector of color names % Output: \% resistance = resistance value corresponding to the color bands [ohms] % \% Remember that the above function header is only a template and the names of an \% output variables can be changed, if desired. load ( 'ColorGuide. mat') colorBands =[ "Red" "Yellow" "Orange" ]; a= strcmpi (ColorCode, colorBands (1)); b= find (strcmpi (ColorCode, colorBands(2))) - 1 ; c= find(strcmpi(Multiplier, colorBands(3))) -1; resistance =((10R1)+R2)10R3 \%string compare find end \begin{tabular}{c|c} \hline urrent Folder & Command Window \\ \hline Name & 17 \\ \hline FindDeflecti... & \\ \hline ColorGuide.... & 1e" \\ \hline Color2Resis... \\ \hline Color2Resis... \end{tabular}Step 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