find an average of ten random numbers input by the user in matlab
main.m
% Define a variable to hold the sumsum = 0;
% Loop ten times to get user input and add it to the sumfori = 1:10% Get input from the user num = input('Enter a number: ');
% Add the input to the sum sum = sum + num;
end% Calculate and display the averageaverage = sum / 10;
fprintf('The average of the numbers is %f\n', average);