我正在尝试将函数保存为类中的变量,以便我可以按顺序访问它们。但是,每当我尝试从以下类中提取任何常量时,都会出现以下错误。
%FORMULAS Summary of this class goes here
% Detailed explanation goes here
properties (Constant)
%F.heatCapacityOfLiquid
t = @(z) z *2
end
properties (Constant)
enthalpyChange = @(constants, temperatureIn, temperatureOut)integral(@(temperature)(@(constants, temperature)...
constants(1)...
+ temperature * constants(2)...
+ temperature.^2 * constants(3)...
+ temperature.^3 * constants(4)), 0,10);
heatCapacityOfLiquid = @(constants, temperature) constants(1)...
+ temperature * constants(2)...
+ temperature.^2 * constants(3)...
+ temperature.^3 * constants(4);
end
end
错误
>> F.t
Invalid default value for property 'enthalpyChange' in class 'F':
Error: Invalid use of operator.