plotting graph including sigma
Show older comments
I am trying to plot this equation.

I have the values of B, omega_d, zeta, N_k and t_j is the multiples of 1.89.
Below is what I tried but the plot is weird and I can't find what's wrong.
Any comment will be helpfull. Thanks!
B_n=-5.36 ;
omega_d= 400;
zeta=29 ;
N_k=10;
sum=0;
for i=1:N_k
t_j= 1.89.*i;
sum= sum+ exp(-(zeta/2).*(t-t_j)).*(-zeta*(sin(omega_d/2.*(t-t_j)))+ omega_d.*cos(omega_d/2*(t-t_j)));
end
sum=B_n/omega_d.*sum;
t=0:10;
plot(t,sum)
2 Comments
Walter Roberson
on 12 Mar 2023
We recommend against using sum as the name of a variable, as it is very common to find that in the same code one also needs to use sum as the name of a function.
Walter Roberson
on 12 Mar 2023
t is not defined in this code.
Accepted Answer
More Answers (0)
Categories
Find more on Conversion Between Symbolic and Numeric in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
