Summation with looping
Ältere Kommentare anzeigen
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.
Akzeptierte Antwort
Weitere Antworten (1)
Image Analyst
am 6 Dez. 2011
2 Stimmen
I think the problem is in your filename:
"imageanalystbs.m"
That sounds like a horrible name to me.
ImageAnalyst
2 Kommentare
Daniel
am 6 Dez. 2011
Salah Saad
am 5 Mai 2015
Bearbeitet: Salah Saad
am 5 Mai 2015
he's being sarcastic...ish, it still is a weird filename
Kategorien
Mehr zu Loops and Conditional Statements finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!