another point is for eg. i have a vector v where i want to replace all the negative number with 0
v = [ 5 4 3 -2 8 9 10 5 8 3 4 7 12 5]
i can use
v(v<0) = 0 (this works fine and return me a modified vector v of lenght 14)
also i can do the operation v = v-3 and this also return me the modified vector v of lenght 14 again
i am not able to understand why can i combine the above to operation in the same command like
v(v<0) = v-3;
this command gives me an error that
In an assignment A(:) = B, the number of elements in A and B must be the same.