Azzera filtri
Azzera filtri

I need to calculate the infinite summation of this equation for different values of x, using a for loop

2 visualizzazioni (ultimi 30 giorni)
Hey guys
I need to find the value of T for different value of x. The values of x are stored in an array and the value of t is constant. And k, c and rho are also constant. I tried symsum, but im getting the following error:
Unable to perform assignment because value of type 'sym' is not convertible to 'double'.

Risposta accettata

Torsten
Torsten il 23 Feb 2023
L = 1;
n = 1:500;
lambda = (2*n-1)*pi/(2*L);
alpha = 1;
t = 0.1;
x = (linspace(0,L,100)).';
f = (-1).^(n+1)./(2*n-1).*exp(-alpha*lambda.^2*t).*cos(lambda.*x);
T = 4/pi*200*sum(f,2);
plot(x,T)

Più risposte (0)

Categorie

Scopri di più su Mathematics in Help Center e File Exchange

Prodotti


Release

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by