]> gitweb.michael.orlitzky.com - octave.git/blobdiff - c_inner_product.m
Add the Octave c_inner_product function.
[octave.git] / c_inner_product.m
diff --git a/c_inner_product.m b/c_inner_product.m
new file mode 100644 (file)
index 0000000..ca98008
--- /dev/null
@@ -0,0 +1,4 @@
+function ip = c_inner_product(w, a, b, v1, v2)
+  integrand = @(x) w(x)*v1(x)*v2(x)
+  ip = quad(integrand, a, b)
+end