From: Jason K on 27 Feb 2010 12:14 Hi, I'm very new to MATLAB, and I'm creating a function that approximates the degree of exactness of any numerical integration quadrature formula (given n+1 quadrature weights and quadrature nodes). But that part isn't all that relevant. My program basically cycles up the standard basis of polynomials, making sure the exact integral of each polynomial is equal to the approximation. When it hits a polynomial for which the approximation of the integral does not equal the integral itself, it records the degree of exactness as the degree of the previous polynomial, and terminates. I use a counter q to keep track of the degree of the polynomial. So for every iteration of the while loop, I need to calculate the exact integral of x^q. How do I do this syntactically? I have tried: I=int('x^q',-1,1); syms x; I=int(x^q,-1,1); F=inline('x^q'); I=int(F,-1,1); Anyone have a tip? It seems quite fundamental. Thanks.
|
Pages: 1 Prev: sending and receiving data in matlab using UDP object Next: adding logo to your graphs |