How do i fix the negative and identical outputs i am getting under the FOR loop?
1 回表示 (過去 30 日間)
古いコメントを表示
i am currently experiencing a challenge under my FOR loop, e.g my W_3 is generating similar and negative outputs while the inputs into the formular are all positive and this is happening throughout the loop.
0 件のコメント
採用された回答
Shunichi Kusano
2019 年 2 月 13 日
"c", the speed of light, defined before the loop is overwritten in the loop. This causes the problem.
0 件のコメント
その他の回答 (1 件)
Walter Roberson
2019 年 2 月 13 日
you are reusing the variable name c . looks like the speed of light before the loop but inside it is reassigned one of the matrix coefficients .
By the way do you have a good reason for approximating pi to only 3.142 ? if so you should comment .
0 件のコメント
参考
カテゴリ
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!