how to plot a summation function in matlab using a for loop
3 ビュー (過去 30 日間)
古いコメントを表示
採用された回答
Rik
2023 年 5 月 28 日
It's a good start.
You should only put the summation part in the loop, and you should store the results in a vector. (remember that the first element of a vector is index 1)
I would also suggest that you use n instead of i.
If you need help implementing this, feel free to post a comment.
4 件のコメント
Rik
2023 年 5 月 28 日
The code you sent me by email is the exact same you posted in your original question. Why didn't you try to implement my advice?
Also, the code you posted will not result in a figure at all, so you didn't show all the code you're using. Neither of these two things are an effective way to solve the problem.
Please post your full code and format it properly. That way you can run it immediately in the editor.
Rik
2023 年 5 月 28 日
I understand it may be difficult to ignore the spammer, but feel free to follow up with a comment.
参考
カテゴリ
Help Center および 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!