Construct if cycle for two variables
Show older comments
Hey guys, I just wanted to check with you if this code is right or is there anyway I could improove it?
This is a function: I want that for the two ifs, status=1 and if the two ifs conditions doesnt apply, then ,status=0.
if angle_transmitter + teta_flutuations_transm <= angle_receiver + teta_flutuations_reflec && angle_transmitter - teta_flutuations_transm >= angle_receiver - teta_flutuations_reflec && Vectors_product_2 ~= 1
status=1;
if angle_transmitter + teta_flutuations_transm >= angle_receiver + teta_flutuations_reflec && angle_transmitter - teta_flutuations_transm <= angle_receiver + teta_flutuations_reflec
status=1;
else
status=0;
end
Accepted Answer
More Answers (1)
Karan Kannoujiya
on 16 Jun 2022
0 votes
Hi Miguel,
For checking the above the condition
you will have to use two ifs and this the right way of doing it.
Categories
Find more on Performance and Memory 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!