Does not throw an error in 2024a
s = simplify(diff(m1c(x),x),'All',true)
s =
[c1 - 14*heaviside(x - 4) + 6*x*heaviside(x - 4), c1 - 14*heaviside(x - 4) + 6*x*heaviside(x - 4)]
[c1 - 14*heaviside(x - 4) + 6*x*heaviside(x - 4), c1 + 3*heaviside(x - 4)*(x - 4) + heaviside(x - 4)*(3*x - 2)]
c1 + 3*heaviside(x - 4)*(x - 4) + heaviside(x - 4)*(3*x - 2) + dirac(x - 4)*(3*x - 2)*(x - 4)
But I don't quite understand what it's returning with first two items containing a comma.
s is an ordinary sym
>> class(s)
ans =
'sym'
And is a column vector
>> size(s)
ans =
3 1
But the first element of s is not a scalar?
>> size(s(1))
ans =
1 2
So a sym array is not necessarily like an ordinary Matlab array?