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

4 visualizzazioni (ultimi 30 giorni)
How can I achieve the 2D-plot with MATLAB?

Risposta accettata

Micheal oguntola
Micheal oguntola il 22 Mag 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)

Più risposte (0)

Categorie

Scopri di più su Line Plots in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by