how can I use the function ‘histfit’ with a cell array?

Hello everyone, I’m trying to use the function ‘histfit’ or 'ksdensity' with a cell array (attached), there are different cells inside, the matter is that is a bit tricky to run a statistical analysis to the whole dataset because the data is stored in this way, what would be the best way to perform this?. Thanks a lot for your help.

댓글 수: 4

The first question is "why?" are the data stored in a manner not conducive to the analys(i|e)s to be done on them?
If, indeed, the desire is to treat the entirety as one dataset, then that is trivial--
locs=cell2mat(locs.');
@dpb The way you explain is organizing all those values in just one column, but if you see the cell array, inside there are columns and rows. Is it possible to organize this in its respective rows and columns (showing all the values)? Probably using the ‘cell2table’ ? however I tried and it doesn’t work like that.
Fercho_Sala
Fercho_Sala 2021년 5월 27일
편집: Fercho_Sala 2021년 5월 27일
@dpb much better if the cell array can be organized like this, showing every content of each cell:
The cell array is comprised of column vectors--either create them as row vectors when generating or transpose the result...
locs=cellfun(@transpose,locs,'UniformOutput',false);
MATLAB isn't a spreadsheet so other than the variable editor window or writing to one or using other display tools, at the command window the default display for cell arrays is what it is.
If you would state explicitly what it is that you want to calculate on what data, then somebody could undoubtedly guide you, but as long as all we can do is guess what the real end objective is, we're just grasping at straws.
Individually, it wouldn't appear there's enough data in any one cell to do too much in the way of any statisical analyses, but not having any klew what the data represent or what the objectives are, simply can't say much about what else to do.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

도움말 센터File Exchange에서 Calendar에 대해 자세히 알아보기

제품

릴리스

R2020b

질문:

2021년 5월 26일

댓글:

dpb
2021년 5월 27일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by