필터 지우기
필터 지우기

Finding the standard deviation for every single value in a matrix

조회 수: 3 (최근 30일)
Abdulhakim Alezzi
Abdulhakim Alezzi 2020년 5월 5일
댓글: Matt J 2020년 5월 5일
Hi Everyone,
I have a 10 matrices X1, X2,X3......X10. Each matrix has a size of (512x30).
1- i want to calculate the mean for all , and the output matrix must be in the same size as input (512x30).
2- Then, i want to calculate the standard deviation for all , and the output matrix must be in the same size as input (512x30).
Any help will be apperciated.
  댓글 수: 3
KSSV
KSSV 2020년 5월 5일
Read about functions mean and std.
Abdulhakim Alezzi
Abdulhakim Alezzi 2020년 5월 5일
I have used these functions, i have calculated the mean and std by :
mymean= mean (x);
mystd= std (mymean);
but the output was a matrix of (1x30).

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

채택된 답변

Matt J
Matt J 2020년 5월 5일
편집: Matt J 2020년 5월 5일
X=cat(3, X1,X2,X3,X4,X5,X6,X7,X8,X9,X10); %It was a mistake to create 10 separate matrices.
MeansX=mean(X,3),
StdX = std(X,[],3)
  댓글 수: 5
Abdulhakim Alezzi
Abdulhakim Alezzi 2020년 5월 5일
X = rand(30,30,512); % Some random data:
B = std(A,[],2); % i got a matrix with 30x1x512.
I want to find get B with a matrix size of 30x30x512.
Matt J
Matt J 2020년 5월 5일
Well as before, you should not have 10 separate variables. You should have a 4D array containing all of your data and then just take std() along the 4th dimension, e.g.,
A=rand(30,30,512,10);
B=std(A,[],4);

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

태그

제품


릴리스

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by