Hi,
The difference in file size between "size" and "size on data medium" can be due to the way MATLAB stores data in mat-files. When you save a mat-file, MATLAB compresses the data to reduce the file size. However, when you load the mat-file, MATLAB decompresses the data, resulting in a larger size in memory.
The program getting slower and slower could be due to the accumulation of data in memory. As you load and process more mat-files, the memory usage increases leading to slower execution. To address this issue, you can use the `clear` command to remove variables from memory after you are done processing each mat-file.