Inline to Anonymous Function
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Russell Buttriss
le 3 Sep 2020
Commenté : Russell Buttriss
le 3 Sep 2020
How can I use anonymous functions to make this plot?
clear all;clc;
x =inline('5*sin(2*pi*1*t).*exp(-.4*t)','t');
t = (-10:.01:10);
plot(t,x(t));
xlabel ('t (seconds)');
ylabel ('Ámplitude');
0 commentaires
Réponse acceptée
Alan Stevens
le 3 Sep 2020
Simply replace your x = inline... etc expression with
x = @(t) 5*sin(2*pi*1*t).*exp(-.4*t);
Plus de réponses (1)
Voir également
Catégories
En savoir plus sur Function Creation 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!