How to find the average of a column in a cell array
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
neilson
am 29 Okt. 2015
Kommentiert: neilson
am 29 Okt. 2015
For our coding assignment we needed to create a cell array with information about elements in a periodic table. I was able to make the cell array using the code attached below. Now I need to find the average of all the 'Atomic Weights' which is one of the inputs that I used in the code. How do I write the code to find the average for all of the Atomic Weights inputted into the cell array?
0 Kommentare
Akzeptierte Antwort
Image Analyst
am 29 Okt. 2015
Why turn it into a cell??????????????????????
Just get the average from the structure array. No need for the overhead and complication of a cell array!
meanAtomicWeight = mean([periodic_table.AtomicWeight]);
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Logical finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!