Hi
So i want to get a heatmap / contour plot of a gaussian prior - before any data has been collected. So essetially im just plotting a 2D covarience funtion. I feel like this should be easy but im going mad trying to sort it out. Does anyone have any ideas where to start?

 채택된 답변

Paul
Paul 2022년 5월 27일

0 개 추천

Something like this?
mu = [1 1];
Sigma = [1 .7*1*sqrt(2); .7*1*sqrt(2) 2];
[X,Y] = meshgrid(-2:.1:4);
p = mvnpdf([X(:) Y(:)],mu,Sigma);
p = reshape(p,size(X));
pcolor(X,Y,p),shading interp

댓글 수: 1

Dave Mansfield
Dave Mansfield 2022년 5월 27일
yeah somthing along those lines, this is definitly a good starting point. Thank you

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

추가 답변 (1개)

Image Analyst
Image Analyst 2022년 5월 27일

1 개 추천

Maybe this:
arrayWidth = 500;
sigma = 80; % Standard deviation.
g = fspecial("gaussian", arrayWidth, sigma); % Create Gaussian matrix.
imshow(g, []);
axis('on', 'image')

카테고리

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

제품

릴리스

R2021b

질문:

2022년 5월 27일

댓글:

2022년 5월 27일

Community Treasure Hunt

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

Start Hunting!

Translated by