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

l Create a matlab function called “non ideal op amp m , This function should tak

ID: 2268723 • Letter: L

Question

l Create a matlab function called “non ideal op amp m , This function should take four inputs and one output and should appear similar to this in the editor: function A-non-ideal op-amp(A0, RF, RI, type) 40 is the open loop gain of the op-amp, RF is the feedback resistor and RI is the resistor connected to the inverting input of the op-amp. Type refers to whether this is going to be an inverting or non inverting configuration. A hint is to make type-1 a non-inverting and type-0 an inverting type op-amp. This function should returm the overall gain of the op-amp circuit. To prove that your function works use the script FHWS test script.m posted with this homework to plot two plots. Include the plots in your homework

Explanation / Answer

function A=non_ideal_op_amp(AO, RF, R1, type)

if(type==0)

gain=-(RF/R1);

elseif(type==1)

gain=1+(RF/R1);

end

end