Making moving obstacles in an matlab
Ältere Kommentare anzeigen
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 Kommentare
Geoff Hayes
am 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
am 2 Jan. 2019
Bearbeitet: Geoff Hayes
am 3 Jan. 2019
Geoff Hayes
am 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
am 3 Jan. 2019
Geoff Hayes
am 3 Jan. 2019
how do you want to decide which points are moving and which aren't? this seems like an implementation detail...
passioncoding
am 3 Jan. 2019
Bearbeitet: Geoff Hayes
am 4 Jan. 2019
Geoff Hayes
am 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
am 4 Jan. 2019
Geoff Hayes
am 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
am 4 Jan. 2019
Pravija Raj
am 19 Aug. 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
am 10 Sep. 2019
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Call Python from MATLAB finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!