フィルターのクリア

How can I plot below discriminant functions (g1(x), g2(x), g3(x))?

1 回表示 (過去 30 日間)
Rosaline Zurock
Rosaline Zurock 2020 年 11 月 28 日
回答済み: Ram 2024 年 2 月 22 日
Under these numbers:

回答 (1 件)

Ram
Ram 2024 年 2 月 22 日
Hi Rosaline, I understand that you want to plot the above three discrimenant functions.
This is a possible approach, please adject the below limits accoding to your needs;
x = linspace(0, 10);
f = @(x) ((0.5/sqrt(2*pi))*exp(-(x-1).^2/2));
g = @(x) ((0.5/sqrt(2*pi))*exp(-(x+1).^2/2));
h = @(x) ((0.5/sqrt(2*pi))*exp(-(x-1).^2/2) + (0.5/sqrt(2*pi))*exp(-(x+1).^2/2));
figure
plot(x, [f(x); g(x); h(x)])
grid
legend('f(x)','g(x)', 'h(x)', 'Location','best')
Output for above code snippet:
Please also check; https://www.mathworks.com/help/matlab/ref/plot.html.
Hope it's helpful.
-Ram

カテゴリ

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

製品


リリース

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by