To find the average of ten numbers in MATLAB, store the numbers in an array and use the mean
function:
main.m160 chars6 lines
The mean
function takes the average of all elements in the input array. In this case, it takes the average of the ten numbers in the numbers
array and assigns it to the avg
variable.
gistlibby LogSnag