how to use symsum for this problem
4 次查看(过去 30 天)
显示 更早的评论
sym=symsum([i-Un]^2,i,1,s);
SD=(sym/n)^1/2;
0 个评论
回答(1 个)
Torsten
2022-9-21
If you use symbolic variables, you should name them as such.
And you shouldn't name a variable "sym", especially if you do symbolic computations.
syms Un n i
symbolic_sum=symsum((i-Un)^2,i,1,n);
SD=simplify((symbolic_sum/n)^1/2)
2 个评论
Walter Roberson
2022-9-21
Caution, ^1/2 is not ^(1/2)
syms Un n i
symbolic_sum=symsum((i-Un)^2,i,1,n);
SD=simplify((symbolic_sum/n)^(1/2))
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Calculus 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!