How to plot the log to base 10 of absolute value of a function containing Sigma (Σ) in 2D

1 view (last 30 days)
How can I achieve the 2D-plot with MATLAB?

Accepted Answer

Micheal oguntola
Micheal oguntola on 22 May 2018
After many trials, I was able to write the code for the above question.
clear all
close all
Nt = 20;
L = 1;
a = 1;
t = 0:3/(Nt-1):3;
q = 0;
M = 100;
for n= 1:M
an = (2*n-1)/(2*L);
bn = an*pi;
cn = bn^2;
An = 2/(1+a*cn)^2;
xn = exp(-2*cn*t/(1+a*cn));
q = q + An.*xn;
end
P_eta_0 = log10(abs(q));
plot(t,P_eta_0)

More Answers (0)

Categories

Find more on Line Plots 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!