Weird error while using constant properties in class

大兔子大兔子 提交于 2021-01-29 06:46:59

问题


I am trying to save functions as variables inside a class so I can reach them in an ordered manner. However, whenever I try to pull any constant from the following class, I get the following error.

    %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

ERROR

>> F.t
Invalid default value for property 'enthalpyChange' in class 'F':
Error: Invalid use of operator.

来源:https://stackoverflow.com/questions/64667602/weird-error-while-using-constant-properties-in-class

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!