MATLAB: I want to solve definite integral with variable limits . can i apply trapezoidal rule for the same

variable limits

t0 = Id/(G0*(Vg-Vt-Id*Rs))
t1 = Id/(G0*(Vg-Vt-Vd+Id*Rd))
r = integral(@(t)1./(t.^2.*log(1-t)),t0,t1);
Id=A/r
where,
G0 = 0.132;
Vg = 0;
Vt = -.485;
Rs = 0.023;
Rd = 0.022;
Id = .003

Best Answer

Can you generate a set of values for t between t0 and t1? Yes. Use linspace.
Can you evaluate that function at those points? Why not?
t = linspace(t0,t1,100);
fun = @(t)1./(t.^2.*log(1-t));
trapz(t,fun(t))
Your code is incomplete, since it fails to define Vd. So I cannot run your code to show that it works.