Borrar filtros
Borrar filtros

Plotting trigonometric, negative exponential functions

4 visualizaciones (últimos 30 días)
Mos_bad
Mos_bad el 20 de Jun. de 2020
Comentada: Mos_bad el 22 de Jun. de 2020
My question could be more related to math than Matlab, but since I want to plot them in matlab, I am asking it here.
I attached the functions that I'm trying to plot.
My Questions are:
1) why my trigonometric function is different from the attached? mine doesn't look like sine and cosine functions at all.
2) how to plot negative exponential function?
Here is my code:
t=1:1:100;
to=1;
th=t(end)-t(1);
b_l=0.2; a_l=1-b_l; % linear coeff
a_t=0.2; b_t=acos(2/a_t)/pi(); % trigonometric coeff
a_e = 0.2; b_e=-log(1/a_e); %exponential coeff
y1 = a_e * exp(-b_e*(t-to)/(th-to)); % exponential
y2 = a_l*((t-to)/(th-to)) + b_l; % linear
y3 = (a_t/2)*( 1 + cos( (pi().*(t-to)*b_t)/(th-to) ) ); % Trigonometric
figure(1);
plot(t,y1,'-k','LineWidth',3); hold on;
plot(t,y2,'-r','LineWidth',3); hold on;
plot(t,y3,'-m','LineWidth',3); hold on;
legend('Exponential','Linear','Trigonometric','FontSize',14,'FontName','Time New Roman','Location','NorthWest');
  3 comentarios
John D'Errico
John D'Errico el 20 de Jun. de 2020
Editada: John D'Errico el 20 de Jun. de 2020
@Mos_bad
Please don't answer your own question just to make a comment. Use a comment instead.
"Here are the math expressions that I found:
f_trigonometric (t) = (a/2) [1+cos( (πb (t-to))/(th- to )) ]
f_exponential (t)=a e^[(-b(t - to))/(th- to )]
and a and b are constants. the to and th in expression are equivalent to t0e and t0e+Tlc in attached figure, respectively.
And for negative exponential function, I don't have any math expression. I just found the attached plot in litrature.
0 Comments"
Mos_bad
Mos_bad el 22 de Jun. de 2020
Any body can help me with this?

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Discrete Data Plots en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by