Help in Plotting X, Y and Heading Angle

1 Ansicht (letzte 30 Tage)
Pranjal Bhatia
Pranjal Bhatia am 18 Okt. 2020
Beantwortet: KSSV am 18 Okt. 2020
Say there are 15 Column vectors where the first 5 columns correspond to X position of first 5 Agents, the next 5 columns correspond to the Y positon and the last 5 towards the heading angle ( Theta ) and say the number of rows for all are 64. So there is a 64X15 Vector say V where
V( : , 1:5 ) = X % This is for 5 agents i.e 1 Column corresponds to Variation of a single agent through time
V( : , 6:10 ) = Y
V( : , 11:15 ) = Theta
How do I plot these 5 Agents on a common graph seeing how they are traversing ?

Antworten (1)

KSSV
KSSV am 18 Okt. 2020
Let V be your 64*15 data matrix.
X = V(:,1:5) ;
Y = V(:,6:10) ;
Z = V(:,11:15) ;
% If you want a surface and the data corresponds to surface
figure(1)
pcolor(X,Y,Z)
shading interp
colorbar
figure(2)
surf(X,Y,Z)
shading interp
colorbar
% If the points correspond to lines
x = X(:) ;
y = Y(:) ;
z = Z(:) ;
plot3(x,y,z)

Kategorien

Mehr zu Mathematics finden Sie in Help Center und File Exchange

Tags

Produkte


Version

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by