I need to get the result like this
mean(cellfun(@(x) x(1,4), thething))
mean(cellfun(@(x) x(2,4), thething))
....
mean(cellfun(@(x) x(n,4), thething))
however my cell are
thething = {26*7 double}
{33*7 double}
{100*7 double}
.....{22*7 double}
not all cells have n lines.I need to use the cells that do have datas to calculate the means to form a plot. thanks!

댓글 수: 3

Kuang-Yu WANG
Kuang-Yu WANG 2018년 6월 26일
sorry i entered the wrong code orz
Walter Roberson
Walter Roberson 2018년 6월 26일
Please do not close questions that have an answer.

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

답변 (1개)

KL
KL 2018년 6월 26일

0 개 추천

It doesn't matter how many lines each cell has. Probably you want something like,
C = {rand(50,7),rand(30,7),rand(100,7)}; %example
C_means = cellfun(@mean,C,'uni',0)

카테고리

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

제품

질문:

2018년 6월 26일

댓글:

2018년 6월 26일

Community Treasure Hunt

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

Start Hunting!

Translated by