sum is also the name of an internal function of MATLAB. Try to avoid such variable names, as in your example you couldn't use the sum function after running this code (until clearing the sum variable)
The above statement initializes a vector of length 50 starting from 1 to 50 (with increments of length 1), and then calls MATLAB's sum function on it, returning the sum of all elements in the vector.
sumis also the name of an internal function of MATLAB. Try to avoid such variable names, as in your example you couldn't use thesumfunction after running this code (untilclearing thesumvariable)