...
2)
I have a function
function y = Voigt (x, wD, g)
y = quad (@(t) w (x, t, wD, g), -10,10);
endfunction
which seems to work
Voigt (0, 5, 0.1)
ans = 30.719
but, I cannot plot it
x=-10:0.1:10;
plot (x, Voigt (x, 4,0.1));
This gives me a constant value.
You need to understand the outputs of your functions. Run Voigt(x, 4, 0.1) before the plot line and see what your output looks like. quad will only produce a scalar output. So it seems you are calling plot with an array for the x value and a single constant for the y value.