Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Problem #3 Resistors have color bands marked on them that indicate the value of

ID: 2079949 • Letter: P

Question

Problem #3 Resistors have color bands marked on them that indicate the value of the resistance in ohms Standard EIA Color Code Table 4 Band 12%, t5%, and t10% 1st 2nd 3rd 4th Band Band Band Band 4th Band 1st Band 2nd Band 3rd Band Color (1st figure) 2nd figure) (multiplier) (tolerance) Black 100 Brown 10 Red 102 Orange 3 3 103 Yellow 104 Green 5 105 106 Blue Violet 107 Gray 8 8 108 White 9 109 10-1 15% Silver +10% Chart Provided By CKIOOND Image courtesy of: http://www.parts-express.com/resources-resistor-color-code-chart

Explanation / Answer

function R=decoderesistor()
%% Provide the three appropriate input the function
% here the fourth band is ignored.
ip1=input('Enter the first colour code letter ','s');

ip2=input('Enter the first colour code letter ','s');

ip3=input('Enter the first colour code letter ','s');

% B b r o y g u v G w d s

if (strcmp(ip1,'B')==1)
R1=0;
elseif (strcmp(ip1,'b')==1)
R1=1;
elseif (strcmp(ip1,'r')==1)
R1=2;
elseif (strcmp(ip1,'o')==1)
R1=3;
elseif (strcmp(ip1,'y')==1)
R1=4;
elseif (strcmp(ip1,'g')==1)
R1=5;
elseif (strcmp(ip1,'u')==1)
R1=6;
elseif (strcmp(ip1,'v')==1)
R1=7;
elseif (strcmp(ip1,'G')==1)
R1=8;
elseif (strcmp(ip1,'w')==1)
R1=9;
elseif (strcmp(ip1,'d')==1)
  
elseif (strcmp(ip1,'s')==1)
else
printf('error input. type correct charector');
end


if (strcmp(ip2,'B')==1)
R2=00;
elseif (strcmp(ip2,'b')==1)
R2=1;
elseif (strcmp(ip2,'r')==1)
R2=2;
elseif (strcmp(ip2,'o')==1)
R2=3;
elseif (strcmp(ip2,'y')==1)
R2=4;
elseif (strcmp(ip2,'g')==1)
R2=5;
elseif (strcmp(ip2,'u')==1)
R2=6;
elseif (strcmp(ip2,'v')==1)
R2=7;
elseif (strcmp(ip2,'G')==1)
R2=8;
elseif (strcmp(ip2,'w')==1)
R2=9;
elseif (strcmp(ip2,'d')==1)
  
elseif (strcmp(ip2,'s')==1)
  
else
printf('error input. type correct charector');
end


if (strcmp(ip3,'B')==1)
R3=0;
elseif (strcmp(ip3,'b')==1)
R3=10^1;
elseif (strcmp(ip3,'r')==1)
R3=10^2;
elseif (strcmp(ip3,'o')==1)
R3=10^3;
elseif (strcmp(ip3,'y')==1)
R3=10^4;
elseif (strcmp(ip3,'g')==1)
R3=10^5;
elseif (strcmp(ip3,'u')==1)
R3=10^6;
elseif (strcmp(ip3,'v')==1)
R3=10^7;
elseif (strcmp(ip3,'G')==1)
R3=10^8;
elseif (strcmp(ip3,'w')==1)
R3=10^9;
elseif (strcmp(ip3,'d')==1)
R3=0.1;
elseif (strcmp(ip3,'s')==1)
R3=0.01;
else
printf('error input. type correct charector');
end

R1
R2
R3
R=((10*R1)+R2)*R3
end

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote