PRACTICAL MATLAB® FOR ENGINEERS PRACTICAL MATLAB

(sharon) #1

Direct Current and Transient Analysis 14 3


Relia=100000*E;
disp(‘**************************************************************’)
disp(‘****************R E S U L T S *******************************’)
disp(‘**************************************************************’)
disp([‘The nominal value of R is ‘, num2str(R),’ohms’])
disp([‘The range of R (tolerance)is between ‘,num2str(Rmin),’ and ‘,
num2str(Rmax),’ Ohms’])
disp([‘The statistical number of failure (reliability) is
‘,num2str(Relia),’ for every 100,000 resistors per 1000 hours of use’])
disp(‘**************************************************************’)
The script fi le color_code is now tested for the resistor R defi ned by the following color
bands: brown, green, orange, silver, and red.
>> color _ code
The first color band, with its numerical values are given below:
Brown=1
Red=2
Orange=3
Yellow=4
Green=5
Blue=6
Violet=7
Gray=8
White=9
Enter the numerical value of the first band, A= 1
The second color band, with its numerical values are given below:
Black=0
Brown=1
Red=2
Orange=3
Yellow=4
Green=5
Blue=6
Violet=7
Gray=8
White=9
Enter the numerical value of the second ban, B= 5
The third color band, with its numerical values are given below:
Silver=-2
Gold=-1
Black=0
Brown=1
Red=2
Orange=3
Yellow=4
Green=5
Blue=6
Violet=7
Gray=8
White=9
Enter the numerical value of the third band, C= 3
The fourth color band, with its numerical values are given below:
Gold=0.05
Silver=0.1
Free download pdf