考慮到MATLAB幫助中的this example。瞭解MATLAB類的屬性
這個例子,除了有語法問題,不接縫爲我工作。我不知道是否是版本問題,我正在使用R2013a。
classdef MyClass
properties (Constant = true)
X = pi/180;
end
properties
PropA = sin(X*MyClass.getAngle([1 0],[0 1]);
end
methods (Static = true)
function r = getAngle(vx,vy)
end
end
end
它說
未定義的函數或變量 'X'。在MyClass的錯誤(1號線) classdef MyClass的
我可以通過添加MyClass.X
修復它,但我不知道這是否是目的。
你應該[報告](HTTP:// WWW。 mathworks.co.uk/support/bugreports)這是一個文檔錯誤。 –