Using a directory to go into an excel file, how calculate an average for a specific column, then calculate the average of all those columns?
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
So I've been able to create a struct of the 203 files in the directory, but I'm having a lot of trouble from there using that directory to go in, one by one, and calculate averages for specific columns of data, and then from there, sum those averages to create an average of those.
One trick here that I've been running into is not all the files have the same column length, so I've been using end-1 to calculate an average for any length of column, but to no success.
Below I've included some screenshots of the code and file structure in the struct I'm looking at, if that helps.
Thanks!
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/171252/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/171253/image.png)
0 Commenti
Risposte (1)
Vishwanath Bailore Acharya
il 16 Apr 2018
I have attached a sample code which achieves the same functionality that you are trying to achieve. Look into it and let me know if it helps you to achieve your functionality.
0 Commenti
Vedere anche
Categorie
Scopri di più su Spreadsheets in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!