load data1.txt
file2 = 'data2.txt';
data2 = load( file2 );
file3 = input( 'Enter the name of the third data file: ', 's' );
data3 = load( file3 );

% Display the number of values, the sum and the average for file1
count1 = length(data1);
sum1 = sum(data1);
avg1 = 0;  % default average value if no data in the file
if count1 > 0
    avg1 = sum1 / count1;
end   
disp(['data1.txt has ' num2str(count1) ' values sum=' num2str(sum1) ' avg=' num2str(avg1) ]);

% Display the number of values, the sum and the average for file2
count2 = length(data2);
sum2 = sum(data2);
avg2 = 0;  % default average value if no data in the file
if count2 > 0
    avg2 = sum2 / count2;
end   
disp(['data2.txt has ' num2str(count2) ' values sum=' num2str(sum2) ' avg=' num2str(avg2) ]);

% Display the number of values, the sum and the average for file3
count3 = length(data3);
sum3 = sum(data3);
avg3 = 0;  % default average value if no data in the file
if count3 > 0
    avg3 = sum3 / count3;
end   
disp([file3 ' has ' num2str(count3) ' values sum=' num2str(sum3) ' avg=' num2str(avg3) ]);

