我正在错误

1视图(最近30天)
卡梅隆·帕特森(Cameron Paterson)
编辑: Stephen23 2021年10月28日
数学错误
t = linspace(0,15);
x =(3*t。^2-5)*(t。^3)*sind(t./2)-8*t+27;
v = 6*t-2.5*(t。^3)*cosd(t./2)-15*t。^2*sind(t./2)-8;
a = 1.25*t^3*sind(t./2)-15*t。^2*cosd(t./2)-30*t*sind(t/2)+6;
绘图(t,x,' - ',t,v,' - ',t,a,' - 。',''lineWidth',1)
标题('streamline')
Xlabel('Time')
Ylabel('速度')
传奇(“ Bestoutside”)
网格

答案(3)

Star Strider
Star Strider 2021年10月28日
在各处使用元素操作,它起作用 -
t = linspace(0,15);
x =(3*t。^2-5)。*(t。^3)。*sind(t./2)-8*t+27;
v = 6*t-2.5*(t。^3)。*cosd(t./2)-15。*t。^2.*sind(t./2)-8;
a = 1.25*t。^3.*sind(t./2)-15。*t。^2.*cosd(t./2)-30。*t。*sind(t/2)+6;
数字
情节(t,x,' - ',电视,' - ',t,a,' - 。',,,,'行宽',1)
标题('精简'
Xlabel('时间'
ylabel('速度'
传奇('X',,,,'v',,,,'一个',,,,'地点',,,,“ bestoutside”
网格
传奇 呼叫还需要包括绘制的变量以及适合该值的名称。

克里斯
克里斯 2021年10月28日
除了袋前的点( 。^ )和斜线( ./ ),您需要在星号前的点( 。* )用于元素乘法。
否则,MATLAB尝试矩阵乘法。

Stephen23
Stephen23 2021年10月28日
编辑:Stephen23 2021年10月28日
您需要使用数组操作,而不是矩阵操作(您错过了乘法):
t = linspace(0,15);
x =(3*t。^2-5)。*(t。^3)。*sind(t./2)-8。*t+27;
% ^ ^ ^ ^
v = 6*t-2.5*(t。^3)。*cosd(t./2)-15*t。^2.*sind(t./2)-8;
% ^ ^
a = 1.25*t。^3.*sind(t./2)-15。*t。^2.*cosd(t./2)-30。*t。*sind(t/2)+6;
% ^ ^ ^ ^ ^ ^ ^ ^
情节(t,x,' - ',电视,' - ',t,a,' - 。',,,,'行宽',1)
标题('精简'
Xlabel('时间'
ylabel('速度'
传奇('地点',,,,“ bestoutside”%我也为您修复了这个
网格

标签

s manbetx 845


发布

R2021A

社区寻宝

在Matlab Central中找到宝藏,发现社区如何为您提供帮助!

开始狩猎!

被某某人翻译