Gaussian Grid in 2d

18 ビュー (過去 30 日間)
PRITAM DAS
PRITAM DAS 2020 年 8 月 30 日
コメント済み: PRITAM DAS 2020 年 9 月 7 日
How to create gaussian grid around some specific point ( x0, y0) and specific sigma( standard deviation) in X-Y plane instead of regular grid point.

回答 (1 件)

Swetha Polemoni
Swetha Polemoni 2020 年 9 月 3 日
Hi,
As per my understanding, you want custom grid lines that follow Gaussian distribution with specified mean and variance. Refer this how grid lines position can be changed using “xtick” and “ytick”. The following code snippet is for better understanding.
figure
x1 = -50:50;
y1 = -50:50;
scatter(x1,y1)
grid on
y_std = 25; % standard deviation along Y axis
y_mean =25 ; % mean along Y axis
y = y_std.*randn(10,1) + y_mean; % Generating Gaussian distribution with specified mean and standard deviation
x_std = 25; % standard deviation along X axis
x_mean = 25; % mean along X axis
x = x_std.*randn(10,1) + x_mean; % Generating Gaussian distribution with specified mean and standard deviation
X_values=sort(x)';
Y_values=sort(y)';
xticks(X_values);
yticks(X_values);
Refer this for more information on how to generate Gaussian distribution with specific mean and variance in Matlab.
  1 件のコメント
PRITAM DAS
PRITAM DAS 2020 年 9 月 7 日
Thank you Swetha Polemoni. It will work fine.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeRandom Number Generation についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by