Summation with looping
古いコメントを表示
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.
採用された回答
その他の回答 (1 件)
Image Analyst
2011 年 12 月 6 日
2 投票
I think the problem is in your filename:
"imageanalystbs.m"
That sounds like a horrible name to me.
ImageAnalyst
2 件のコメント
Daniel
2011 年 12 月 6 日
Salah Saad
2015 年 5 月 5 日
編集済み: Salah Saad
2015 年 5 月 5 日
he's being sarcastic...ish, it still is a weird filename
カテゴリ
ヘルプ センター および File Exchange で Loops and Conditional Statements についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!