- R = Magnitude of resultant vector
- α = Direction of resultant vector
- SpeedX = Magnitude of vector X, aka the velocity of X
- SpeedY = Magnitude of vector Y, aka the velocity of Y
- θ = Angle between two vectors, which in every case is pi/2 since the vectors SpeedX & SpeedY will always being 90 degrees from one another.

# How to plot data (t,X,Y) data of 10 mobile nodes and How to normalize the different time stamps for all nodes.?

1 view (last 30 days)

Show older comments

Hi,

I need your guidance regarding plotting data of 10 mobile nodes moving randomly in a given time and I have data with (time,Xposition,Yposition). I have used plot3. As I have value of (time,Xposition,Yposition) and all the values are uncorrelated with each other. Whether it is possible that I can make different time stamps of different mobile node a single time instance so that I can get the idea how they are behaving at different time intervals.

Secondly Is it possible that given Speed(Vx,Vy)and (time, Xposition, Yposition),I can get the direction of any mobile node at any instance of time?

Need guidance. Thanks

##### 0 Comments

### Answers (1)

Midimistro
on 22 Dec 2015

I am not sure you are describing your first question clearly. Is what your trying to ask is if you can find the gap between each variable of "time" and plot it against X & Y? If so, the answer is yes you can. You can calculate the gaps via this:

A = [time];

B = [time(2:end)];

C = time(end);

D = [B;C];

E = D-A.

E will be your gap vector, which you can use to plot against X and Y in the 3D plot.

Regarding your question about direction, yes you can find the direction. To do this use the following formula:

R = sqrt( (SpeedX^2)+(SpeedY^2)+(2*SpeedX*SpeedY*cos(pi/2) )

and

α = arctan( ((SpeedY)*sin(pi/2)) / (SpeedX+(SpeedY*cos(pi/2))) )

where:

Notice that you do not need PositionX, and PositionY to calculate direction. These calculations will allow you to graph the direction and magnitude against the original given variables and can be legitimate so long as SpeedX, SpeedY, PositionX, PositionY, and time all are the same array size.

If you need further clarification, please let me know. Seems as though you are dealing with physics.

##### 0 Comments

### See Also

### Categories

### Community Treasure Hunt

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

Start Hunting!