]> gitweb.michael.orlitzky.com - octave.git/blob - c_inner_product.m
Fix a comment.
[octave.git] / c_inner_product.m
1 function ip = c_inner_product(w, a, b, v1, v2)
2 %
3 % The usual inner product defined on the space of continuous
4 % functions over the interval [a,b].
5 %
6 % INPUT:
7 %
8 % * ``w`` -- The weight function.
9 %
10 % * ``a`` -- The left endpoint of the interval.
11 %
12 % * ``b`` -- The right endpoint of the interval.
13 %
14 % * ``v1`` -- The first vector.
15 %
16 % * ``v2`` -- The second vector.
17 %
18 % OUTPUT:
19 %
20 % The inner product <v1, v2>.
21 %
22 integrand = @(x) w(x)*v1(x)*v2(x);
23 ip = quad(integrand, a, b);
24 end