If I have this I get an error
sum(vector) == cumsum(vector)(length(vector))
>> Error: ()-indexing must appear last in an index expression.
I know I can just do:
Vec1 = cumsum(mat);
sum(mat) == Vec1(length(mat))
which will return a logical 1.
Is there an alternative to get everything on a single line?
()
operator,subsref
. See my answer. It's just trivia, really. – Enrichetta