Making moving obstacles in an matlab
이전 댓글 표시
I have created random obstacles in MATLAB, (they are user acquired) now I am trying to make some obstacles randomly moving.
I Know that, in every iteration value of some obstacle be updated by adding some threshold valueto it.
But I am getting how to write up in code.
Kindly help me
댓글 수: 12
Geoff Hayes
2019년 1월 2일
faiza - you may want to provide more details or show some code so that we can get a better idea of what you are attempting to do. How are you storing the obstacles? Does each obstacle have a different speed? etc.
passioncoding
2019년 1월 2일
편집: Geoff Hayes
2019년 1월 3일
Geoff Hayes
2019년 1월 3일
faiza - so you will probably want to save the handle of each "plotted" obstacle to an array and then decide (somehow) which obstacle is randomly chosen to move in some direction with some speed (how will you determine this?).
passioncoding
2019년 1월 3일
Geoff Hayes
2019년 1월 3일
how do you want to decide which points are moving and which aren't? this seems like an implementation detail...
passioncoding
2019년 1월 3일
편집: Geoff Hayes
2019년 1월 4일
Geoff Hayes
2019년 1월 4일
faiza - but how do you want to choose the new position? Do you randomly choose a direction? And randomly choose a speed?
passioncoding
2019년 1월 4일
Geoff Hayes
2019년 1월 4일
so you want to generate a random speed for each obstacle and then use that speed for the remainder of the simulation...that should be relatively straightforward. You have an array of obstacles and so need to generate an array of speeds for each obstacle (where a speed can be zero for obstacles that are stationary). You will also need an array of directions unless the direction can change for each iteration of the simulation?
passioncoding
2019년 1월 4일
Pravija Raj
2019년 8월 19일
Hello Faiza,
I am working with a similar situation. Were you able to figure out the code for your scenario. Please kindly share if you have.
I will explain my problem here. I need to simulate an object that randomly moves in a square area in any direction for a duration of time with a random speed. Can any one help me with the code for this.
passioncoding
2019년 9월 10일
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Call Python from MATLAB에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!