Summation with looping
Mostrar comentarios más antiguos
Find ∑((x^)n/n!) for x=1.8 and n=0 to 16.
Okay, my first attempt to do this looked like:
x = 1.8 For(0:16) xs = sum((x^n)/factorial(n)) end
xs
But I received the error: ??? Error: File: imageanalystbs.m Line: 11 Column: 6 Unexpected MATLAB expression.
My line 11 is the one with "For (0:16)"
What am I doing wrong here? Any help is appreciated.
Respuesta aceptada
Más respuestas (1)
Image Analyst
el 6 de Dic. de 2011
2 votos
I think the problem is in your filename:
"imageanalystbs.m"
That sounds like a horrible name to me.
ImageAnalyst
2 comentarios
Daniel
el 6 de Dic. de 2011
Salah Saad
el 5 de Mayo de 2015
Editada: Salah Saad
el 5 de Mayo de 2015
he's being sarcastic...ish, it still is a weird filename
Categorías
Más información sobre Loops and Conditional Statements en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!