matlab waveform help

Thread Starter

awesome2999

Joined Apr 10, 2010
7
Hi there,
I am completely new to matlab and don't know how to draw a waveform of

matlab code
VT=0.0252;
vin=1.5+cos(2*pi*100*t);
R=2000;
Is = 1/10000000000000000;
t=linspace(0,0.03,1000);
Vout=-VT*log(vin/R*Is);
plot(t,Vout);

i don't know how to get the right answer because the Vout should be around 0.72 to .76sinewave form

note: vin=1.5+cos(2*pi*100*t); means that peak value is 2.5 and lowest values is 0.5 which should be sub in Vout equation.

please help me to get the right code
thank-you for your help
cheers
 
Top