フィルターのクリア

fit gaussian to a known sigma

1 回表示 (過去 30 日間)
Emily Pendleton
Emily Pendleton 2018 年 1 月 18 日
コメント済み: Star Strider 2018 年 1 月 19 日
Hello, I am trying to visualize/plot a standard gaussian fit [a*exp(-((x)/c)^2)] with a known value for c. In this case, it should be fine if a=1.
I am having trouble plotting this since I do not have coordinate pairs to make the graph. I would prefer using a code to do this rather than the curve fitting toolbox if possible because I want to visualize multiple curves at once. Thank you so much for your help!

採用された回答

Star Strider
Star Strider 2018 年 1 月 18 日
Try this:
gaussfcn = @(b,x) b(1).*exp(-((x)./b(2)).^2);
xv = linspace(-10, 10);
b = [1; 4.2];
yv = gaussfcn(b, xv);
figure(1)
plot(xv, gaussfcn(b, xv))
grid
  4 件のコメント
Emily Pendleton
Emily Pendleton 2018 年 1 月 19 日
thank you!
Star Strider
Star Strider 2018 年 1 月 19 日
As always, my pleasure!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeInterpolation についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by