フィルターのクリア

Plot a 2D Gaussian prior

89 ビュー (過去 30 日間)
Dave Mansfield
Dave Mansfield 2022 年 5 月 27 日
コメント済み: Dave Mansfield 2022 年 5 月 27 日
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 日
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 日
Maybe this:
arrayWidth = 500;
sigma = 80; % Standard deviation.
g = fspecial("gaussian", arrayWidth, sigma); % Create Gaussian matrix.
imshow(g, []);
axis('on', 'image')

カテゴリ

Help Center および File ExchangeData Distribution Plots についてさらに検索

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by