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');

 Respuesta aceptada

Alan Stevens
Alan Stevens el 3 de Sept. de 2020

0 votos

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

Más respuestas (1)

Fangjun Jiang
Fangjun Jiang el 3 de Sept. de 2020

0 votos

x =@(t) 5*sin(2*pi*1*t).*exp(-.4*t)'

Categorías

Más información sobre Function Creation en Centro de ayuda y File Exchange.

Productos

Versión

R2019b

Preguntada:

el 3 de Sept. de 2020

Comentada:

el 3 de Sept. de 2020

Community Treasure Hunt

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

Start Hunting!

Translated by