I want to create a rectangular plot where all 4 sides are part of a coordinate system.

17 次查看(过去 30 天)
I have currently a linear Plot of a heading output from a flight simulator. But i would like plot this on a rectangular plot where it will be displayed like a flight route. The Values are in cells. This is my current output
Maybe somebody can help me how i can convert everything that it will be displayed like a route on the plot. As you can see the flight was just cirlcles so the lines should always overlay each other more or less.
Thanks for everybody who has an idea.
  1 个评论
Fangjun Jiang
Fangjun Jiang 2024-3-21
You will need the flight speed. Do an integration of the speed in combination with the heading, you will get the (x,y) postion of the plane. Plotting the (x,y) will give you the flight path (likely in circles).

请先登录,再进行评论。

回答(1 个)

Vinay
Vinay 2024-9-3,8:13
Hii Yannick,
To visualize the flight data as a route on a rectangular plot, I would suggest you to convert the heading data into a 2D path by simulating the movement based on the heading angles.
The approach is to simulate the movement based on the heading angles, treating each angle as a direction in which the plane progresses over time.
Kindly refer to the following documentation for “deg2rad”:
% Sample heading data (in degrees)
heading_angle = [0, 45, 90, 135, 180, 225, 270, 315, 360]; % Example heading data
% Convert headings to radians
heading_angle_rad = deg2rad(heading_angle);
% Initialize position
x = 0;
y = 0;
% Store positions for plotting
x_positions = [x];
y_positions = [y];
% step size for each heading increment
step_size = 1; % Adjust this value based on your data's resolution
% Calculate positions
for i = 1:length(heading_angle_rad)
% Update position based on heading
x = x + step_size * cos(heading_angle_rad(i));
y = y + step_size * sin(heading_angle_rad(i));
% Store new position
x_positions = [x_positions, x];
y_positions = [y_positions, y];
end
% Plot the flight path
figure;
plot(x_positions, y_positions, '-o');
xlabel('X Position');
ylabel('Y Position');
title('Flight Route');
grid on;
axis equal;

类别

Help CenterFile Exchange 中查找有关 Line Plots 的更多信息

标签

产品


版本

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by