Why doesn't the less than operator work inside a for loop for decimals
Show older comments
Im trying to get the following code to work. but every time the value of x goes below 0.6 even though it an if condition is set to prevent it..can someone help
x=0.8;
for n=1:10
if (x>0.6)
x=x-0.1;
end
x
end
Accepted Answer
More Answers (0)
Categories
Find more on Logical in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!