Plotting trigonometric, negative exponential functions
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
John D'Errico
le 20 Juin 2020
Modifié(e) : John D'Errico
le 20 Juin 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"
Réponses (0)
Voir également
Catégories
En savoir plus sur 2-D and 3-D Plots dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!