std in matlab cell

조회 수: 5 (최근 30일)
Tomas
Tomas 2013년 11월 11일
댓글: Tomas 2013년 11월 11일
i have cell for exaple {1x7 cell} in cell Z{1} ans =
Columns 1 through 6
[1x3 double] [1x3 double] [1x3 double] [1x3 double] [1x3 double] [1x3 double]
Column 7
[1x3 double]
>> Z{1}{1}
ans =
5.4000 8.3000 15.8000
I want the standard deviation of each element in the array
for example: std(5.4), std(8,3) std(15,8)
I dont know how to use standard devation in cell array.
Thanks.
  댓글 수: 2
Azzi Abdelmalek
Azzi Abdelmalek 2013년 11월 11일
What are you expecting with std(4.5) ?
Maybe you mean the std of each array in your cell array Z
Tomas
Tomas 2013년 11월 11일
i know std(4.5)=0 , but i have std each element in matrix,

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

답변 (1개)

Azzi Abdelmalek
Azzi Abdelmalek 2013년 11월 11일
편집: Azzi Abdelmalek 2013년 11월 11일
Z={[1 2 3],[6 8 12],[3 12 20]}
out=cellfun(@std,Z)
The result will be a 1x3 array
std of [1 2 3]
std of [6 8 12]
std of [3 12 20]
  댓글 수: 1
Tomas
Tomas 2013년 11월 11일
Thanks, I'll use it

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by