Calculating statistical functions for a structure array which each cell has a different size
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Farbod Tavakkoli Khomeini
am 18 Okt. 2019
Kommentiert: Farbod Tavakkoli Khomeini
am 18 Okt. 2019
Hi,
I have a structure array which is mentioned below.
59x1 double 38x1 double 39x1 double 25x1 double 16x1 double
Each cell in my array includes some data and the number of data for each cell varies from one to another. Indeed, I have provided a small piece of my array here. The original one has 1600 cells and each cell contains about 40-80 data.
I know how to calculate the Mean, Variance, Skewness, Kurtosis, Max, Min, Median and quantile (10-90) when I'm working with a matrix but I cannot do the same task for a structure array. I really need to calculate the mentioned mathematical functions for my array.
Please let me know what should I do.
I have been struggling with this issue for a week and still don't know what should I do.
0 Kommentare
Akzeptierte Antwort
Matt J
am 18 Okt. 2019
Bearbeitet: Matt J
am 18 Okt. 2019
A structure array doesn't have "cells" and doesn't look like that. I assume you really mean your data is a cell array, in which case, you can use cellfun, e.g.,
mean_of_cells = cellfun(@mean, myData)
3 Kommentare
Matt J
am 18 Okt. 2019
Also, I cannot use this funtion for Min, Max, and Quantile.
Why not?
Actually, I want calculate the Mean of the whole array
Just concatenate all your cells into one array
array=vertcat(myData{:});
mean(array)
max(array)
etc...
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Creating and Concatenating Matrices 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!