second expression and second statement doesn't excuted in else if ?
Show older comments
why the second condition and second statments don't take into account (doeasn't excuted ) ? when I excuted the code only the first condition and its statment excuted as well as to the last statement
if condition 1
do some calculation 1
elseif condition 2
do some calculation 2
else
do some calculation 3
end
3 Comments
Torsten
on 24 Aug 2022
The most probable answer is: condition 2 was never true.
To tell you something more useful, we have to see your code.
omar th
on 24 Aug 2022
It could be that the second conditon was never true when the first condition was false.
if true % 1st condition always true
elseif true % 2nd condition also always true but never checked
else
end
Accepted Answer
More Answers (0)
Categories
Find more on Startup and Shutdown 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!