As Octave does not seem to bring a Gauss function for 1D or 2D by default I tried to define those functions by myself.
I started of with the definition
function [result] = Gauss(x,[x0 sigma])
result = 1/(sqrt(2*pi*sigma^2))*exp(-1(x-x0)^2/2*sigma^2)
end
which resulted in a subscript error
error: subscript indices must be either positive integers or logicals
I Tried to modify the function definition as follows:
function [result] = Gauss(x,[x0 sigma])
as I found a function gaussmf from Matlab, where you can pass an array x and single numbers in x0 and sigma. Unfortunately I still get a subscription error with that.
So my question is: How can I pass an array and additional non-array arguments in this case? I thought this would be rather automatic, but does not seem to be... ;)
Thanks
normpdf()for the 1D case. You can't define functions that way. Please read the manual. - juliohm