I need to calculate the infinite summation of this equation for different values of x, using a for loop
3 ビュー (過去 30 日間)
古いコメントを表示
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'.
0 件のコメント
採用された回答
Torsten
2023 年 2 月 23 日
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)
0 件のコメント
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!