How do i fix the negative and identical outputs i am getting under the FOR loop?
1 view (last 30 days)
Show older comments
kumbirayi
on 13 Feb 2019
Answered: Walter Roberson
on 13 Feb 2019
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 Comments
Accepted Answer
Shunichi Kusano
on 13 Feb 2019
"c", the speed of light, defined before the loop is overwritten in the loop. This causes the problem.
0 Comments
More Answers (1)
Walter Roberson
on 13 Feb 2019
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 Comments
See Also
Categories
Find more on Loops and Conditional Statements in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!