Matalab assignment: ( I need the code please ) 2. Create a function that accepts
ID: 2249623 • Letter: M
Question
Matalab assignment: ( I need the code please )2. Create a function that accepts two input variables, R1 and R2, and calculated the duty cycle of the astable 555 timer circuit. The function should have one output variable, dc, which should be a decimal representation of the duty cycle (i.e 50% = 0.5, 25%=0.25, etc.). B
Matalab assignment: ( I need the code please )
2. Create a function that accepts two input variables, R1 and R2, and calculated the duty cycle of the astable 555 timer circuit. The function should have one output variable, dc, which should be a decimal representation of the duty cycle (i.e 50% = 0.5, 25%=0.25, etc.). B
2. Create a function that accepts two input variables, R1 and R2, and calculated the duty cycle of the astable 555 timer circuit. The function should have one output variable, dc, which should be a decimal representation of the duty cycle (i.e 50% = 0.5, 25%=0.25, etc.). B
Explanation / Answer
For a 555 timer IC operating in astable multivibrator, Duty cycle D = (R1+R2)/(R1+2R2) which gives the values in decimal.
MATLAB CODE :
function dc = duty_cycle(R1,R2)
dc=(R1+R2)/(R1+2*R2);
end