1function [x,w] = glwt(a,b,gl)
2%GLWT convert GL nodes and weights over [-1,1] to ones over [a,b]
3%
4%[x,w] = glwt(a,b,x0,w0) returns GL nodes and weights x and w over [a,b]
5% given GL nodes and weights x0,w0 over [-1,-1]
7% get nodes and weights
8x0 = gl.x0;
9w0 = gl.w0;
11% Linear map from[-1,1] to [a,b]
12x=(a*(1-x0)+b*(1+x0))/2;
14% Compute the weights
15w=(b-a)*w0;
17end