Can we use elseif in a conditional statement this much time?%shortest path selection algorithm for R1
Show older comments
%shortest path selection algorithm for R1
if YR11>YR12
small_dist_R11=YR12
elseif YR12>YR11
small_dist_R11=YR11
elseif small_dist_R11>YR13
small_dist_R12=YR13
elseif YR13>small_dist_R11
small_dist_R12=small_dist_R11
elseif small_dist_R12>YR14
small_dist_R13=YR14
elseif YR14>small_dist_R12
small_dist_R13=small_dist_R12
elseif small_dist_R13>YR15
small_dist_R14=YR15
else
small_dist_R14=small_dist_R13
end
Accepted Answer
More Answers (0)
Categories
Find more on Creating, Deleting, and Querying Graphics Objects 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!