Making moving obstacles in an matlab
Afficher commentaires plus anciens
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 commentaires
Geoff Hayes
le 2 Jan 2019
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
le 2 Jan 2019
Modifié(e) : Geoff Hayes
le 3 Jan 2019
Geoff Hayes
le 3 Jan 2019
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
le 3 Jan 2019
Geoff Hayes
le 3 Jan 2019
how do you want to decide which points are moving and which aren't? this seems like an implementation detail...
passioncoding
le 3 Jan 2019
Modifié(e) : Geoff Hayes
le 4 Jan 2019
Geoff Hayes
le 4 Jan 2019
faiza - but how do you want to choose the new position? Do you randomly choose a direction? And randomly choose a speed?
passioncoding
le 4 Jan 2019
Geoff Hayes
le 4 Jan 2019
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
le 4 Jan 2019
Pravija Raj
le 19 Août 2019
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
le 10 Sep 2019
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Graphics Performance dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!