Azzera filtri
Azzera filtri

Inline to Anonymous Function

2 visualizzazioni (ultimi 30 giorni)
Russell Buttriss
Russell Buttriss il 3 Set 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');

Risposta accettata

Alan Stevens
Alan Stevens il 3 Set 2020
Simply replace your x = inline... etc expression with
x = @(t) 5*sin(2*pi*1*t).*exp(-.4*t);

Più risposte (1)

Fangjun Jiang
Fangjun Jiang il 3 Set 2020
x =@(t) 5*sin(2*pi*1*t).*exp(-.4*t)'

Categorie

Scopri di più su Function Creation in Help Center e File Exchange

Prodotti


Release

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by