how can I make this loop in matlab

댓글 수: 6

darova
darova 2020년 3월 5일
You need to use while loop and if..else statements. DO you have any attempts?
areej abdulshaheed
areej abdulshaheed 2020년 3월 5일
I don't know how to do while loop. Can you write it for me please?
darova
darova 2020년 3월 5일
Unfortunately no. I want you to make some effort
areej abdulshaheed
areej abdulshaheed 2020년 3월 5일
Thats mean you don't know also. I will try with if and waiting better answer. Any way thank you.
darova
darova 2020년 3월 5일
I voted for your question so you can get help faster
Bruno Luong
Bruno Luong 2020년 7월 28일
I voted for your question so you can get help faster
What if you haven't made a vote? :-)

답변 (1개)

Maria
Maria 2020년 7월 28일

0 개 추천

Your logic path translates to something like this:
while (1)
[obstfront, minobs] = URG_scane ();
if (obstfront > minobs)
%Rise head
%URG_scane
if (obstfront > minobs)
%Put downs the head
%URG_scane
if (obstright < minobs)
%Turn right 60 min
elseif (obstleft < minobs)
%Turn left 60 mins
else
%Go backward (20 min)
break;
else
%Obstacle climbing 100 mins
end
else
%Go forward 20 MIN
end
end
You should now write the code for each different function (as URG_scane, Go_forward, etc.). Hope this helps!

이 질문은 마감되었습니다.

태그

질문:

2020년 3월 5일

마감:

2021년 8월 20일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by