how to use symsum for this problem

4 visualizaciones (últimos 30 días)
Ashutosh
Ashutosh el 21 de Sept. de 2022
Comentada: Walter Roberson el 21 de Sept. de 2022
sym=symsum([i-Un]^2,i,1,s);
SD=(sym/n)^1/2;

Respuestas (1)

Torsten
Torsten el 21 de Sept. de 2022
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)
SD = 
  2 comentarios
Ashutosh
Ashutosh el 21 de Sept. de 2022
thank you
Walter Roberson
Walter Roberson el 21 de Sept. de 2022
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))
SD = 

Iniciar sesión para comentar.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by