How can I make a normal distribution with n*n matrix?
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Amin Gan
am 12 Feb. 2016
Kommentiert: Amin Gan
am 12 Feb. 2016
Matrix A is 1000*1000 in size. I want to make normal PDF of each row( for example A(1,1:1000) and then A(2,1:1000) and...), by normpdf(A,mean(A),std(A)) function.
can you please advise?
thank you
0 Kommentare
Akzeptierte Antwort
the cyclist
am 12 Feb. 2016
% Made up some pretend data
N = 1000;
A = randn(N);
% Preallocate memory for the pdfs
Y = zeros(N);
% Calculate the pdfs
for nr = 1:N
Y(nr,:) = normpdf(A(nr,:),mean(A(nr,:)),std(A(nr,:)));
end
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!