MATLAB: How to add all values greater than specific value in coloumn vector

addition

I have a coloumn vector of length(30*1) i want to add all values greater than 1 in that coloumn how can i do that please help me i am new in matlab. Thanks

Best Answer

If A is your vector, simply do
s = sum(A(A>1));