Inline to Anonymous Function

2 次查看(过去 30 天)
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');

采纳的回答

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

更多回答(1 个)

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

类别

Help CenterFile Exchange 中查找有关 Function Creation 的更多信息

产品


版本

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by