The following function shows one possible approach to solve this problem . I assume that the dataset contains 1000x1 double values as a table.
function res= f(dataset, Vs)
The 'sum' function performs the summation of elements in array 'y'. Refer this link to read more on how to access data in tables.