how to calculate functions
3 views (last 30 days)
Steven Lord on 2 Aug 2022
You don't need the line of code where you define t as a symbolic variable, since on the next line you throw that symbolic variable away and assign a numeric vector to that identifier.
t = -3:0.1:10;
I believe you will need to make one change to your function. You need to use element-wise division (./) instead of matrix division (/) in the second term if you want to divide each element of exp(-t) by the corresponding element of t.
y = 4*sin(2*pi*t) + exp(-t)./t;
Note that your function is undefined at t = 0.