0

我如何在情节中改变我的虚线???我知道它是这样完成的,plot(x, y, '-')但即使我把它放在那里,我也会得到虚线

naj_cas = 0;
uhol_deg = -5;
v = 20;
g = 9.80665;

while uhol_deg < 85
    uhol_deg = uhol_deg + 10;
    uhol_rad = degtorad(uhol_deg);

    for t = 0:.1:5
        x = v * t * cos(uhol_rad);
        y = v * t * sin(uhol_rad) - 0.5 * g * t^2;
        axis([0 50 0 25])
        subplot(211);
        plot(x, y)
        hold on
    end
end
4

1 回答 1

2

您正在绘制单个点而不是一条线。这些显示为点,对线属性的任何更改都没有影响。试试这个:

t = (0:.1:5);    
while uhol_deg < 85
    uhol_deg = uhol_deg + 10;
    uhol_rad = pi*uhol_deg/180;

    x = v * t * cos(uhol_rad);
    y = v * t * sin(uhol_rad) - 0.5 * g * t.^2;
    axis([0 50 0 25])
    plot(x, y)
    hold on
end
于 2012-10-17T19:30:03.260 回答