0
これは射影モーショングラフです。グラフのプロットまで完全な計算が含まれています。私は計算部分の後にコードを使ってグラフの設定を変更する方法を理解していません。 this is what i've plotted using this code belowは完全にグラフのグラフをmatlab guiに含めることはできません。プロットの半分だけを表示します
time = linspace(0, t, 1000);
legends = {}; % Instantiate an empty cell for the angle legend.
counter = 1;
for A = 10: 10 : 90
% Get the components of velocity in the x and y directions for this angle.
vx = v*cosd(A);
vy = v*sind(A);
% Compute the distance along the x direction. x = x0 + x_velocity * time.
xfinal = vx * time;
% Compute the distance along the y direction. y = y0 + y_velocity_initial *
%time + (1/2)*g*time^2
yfinal = vy * time + (1/2) * 9.81 * time .^ 2;
% Clip y to zero because we assume the projectile stays on the ground when
%it hits.
% It does not penetrate and have a negative y.
yfinal(yfinal < 0) = 0;
indexHitGround = find(yfinal > 0, 1, 'last');
fontSize=10
plot(xfinal, yfinal, '-', 'LineWidth', 2);
hold on;
legends{end+1} = sprintf('Angle = %d', A);
% Calculate the range in the x direction.
xFinal(counter) = xfinal(indexHitGround);
counter = counter + 1;
end
grid on;
xlabel('X Coordinate', 'FontSize', fontSize);
ylabel('Y Coordinate', 'FontSize', fontSize);
title ('Projectile Trajectory', 'FontSize', fontSize)
legend(legends);
% Find the max xFinal and set the range of the graph to be that.
xlim([0, max(xFinal)]);
% Set up figure properties:
% Enlarge figure to full screen.
set(gcf, 'Units', 'Normalized', 'OuterPosition', [0.2, 0.3, 0.8, 0.7]);
% Get rid of tool bar and pulldown menus that are along top of figure.
set(gcf, 'Toolbar', 'none', 'Menu', 'none');
% Give a name to the title bar.
set(gcf, 'Name', 'Projectile Trajectory Demo Part 2', 'NumberTitle', 'Off')
のようなものをプロットしようとしているのに対し、私はあなたが私のコードでエラーを指摘したり、私を与える場合ので、私は本当に感謝してMATLABに初心者ですいくつかの提案。ありがとう!