我有两个符号功能:
func stringWithString(stringToReplace:String, replacedWithString newStringPart:String) -> NSMutableAttributedString
{
let mutableAttributedString = mutableCopy() as! NSMutableAttributedString
let mutableString = mutableAttributedString.mutableString
while mutableString.containsString(stringToReplace) {
let rangeOfStringToBeReplaced = mutableString.rangeOfString(stringToReplace)
mutableAttributedString.replaceCharactersInRange(rangeOfStringToBeReplaced, withString: newStringPart)
}
return mutableAttributedString
}
(fun = @(x) sum((5-2*x+(7-5*x)*A-B).^2);
fun2 = @(x) sum((8-2*x+(6-5*x)*A-B).^2);
和A
是矩阵)。
现在我想将这两个函数添加到一个新函数B
中:
func3
但是我收到了这个错误:
fun3 = fun + fun2
如何添加这两个功能?