MATLAB: How to plot this exponential decaying sinusoid

ethyl alcoholexponential decaying sinusoidfluidoilwater

y(x) = F * exp^(-a*x) * sin(bx)
pick you own values for x vector.
value of a and b:
ethyl alcohol 0.246 0.806
water 0.250 1.000
Oil 0.643 1.213
plot using the values above for each fluid.
Here is a portion of my approach.
extf = input('Please enter the magnitude of the external force: ');
yethylalchol == extf*exp(-0.246*x).*sin(0.806*x);
plot( x,yethylalcohol,'c*' )
hold on
ywater == extf*exp(-0.250*x).*sin(1*x);
plot( x,ywater,'r+' )
hold on
yoil == extf*exp(-0.643*x).*sin(1.213*x);
plot( x,yoil, 'yp')
What am I doing wrong? Help please!!!

Best Answer

Nabin, how about
% value of a and b:
% ethyl alcohol 0.246 0.806
% water 0.250 1.000
% Oil 0.643 1.213
F = 1;
x = 0:0.1:2*pi;
a = [0.246 0.250 0.643]';
b = [0.806 1.000 1.216]';
y = F * exp(-a*x).*sin(b*x);
plot(x,y)