Need Help Coding a Gaussian Problem
조회 수: 1 (최근 30일)
이전 댓글 표시
Hi, I am currently trying to code the following gaussian equation:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/605140/image.png)
and my code is seen as below:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/605145/image.png)
But my graphs just don't seem to come out right. The output that I get is this
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/605150/image.png)
but the actual output should look like the graph below
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/605155/image.png)
I cannot see where I am going wrong. Any help would be greatly appreciated!
댓글 수: 0
답변 (1개)
Doddy Kastanya
2021년 5월 5일
You might not be using the correct data for this. For example, in your implementation x_i and x_j are simply numbers. Shouldn't they actually be vectors? Otherwise, there is no need to use the "norm" function.
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!