function [B1] = n10278273RotatingRod([x0,y0]; t)
%RotationRod function accepts a vector with initial position x1, y1 and rotates
%for time (t). Giving the final position as an output.
B0 = [x0, y0] %initial location of first rod
R = rotx(sin(2*t/pi)) %constructs a matrix to rotate the input vector (A)
B1 = B0*R
end
尝试旋转矢量,得到以下错误: “未定义的函数或变量'x0'。”
答案 0 :(得分:0)
您正在制作语法错误。您应该将您的功能定义为: function [B1] = n10278273RotatingRod(x0,y0,t)