1 2 3 4 5 6 7 8 9
// calculating output voltage due to offset voltage clc; V1=1; V2=-2; Rf=500; R1=250; R2=100; Vo=-{[(Rf/R1)*V1]+[(Rf/R2)*V2]}; disp(Vo,'output voltage(V)=')