I need to get N x columns(L) matrix of legendre polynomials evaluated over L for arbitrary N.
Is there a better way of computing the matrix than just explicitly evaluating the polynomial vector for each row? The code snippet for this approach (N = 4) is here:
L = linspace(-1,1,800);
# How to do this in a better way?
G = [legendre_Pl(0,L); legendre_Pl(1,L); legendre_Pl(2,L); legendre_Pl(3,L)];
Thanks,
Vojta
Copyright Notice:Content Author:「vojta havlíček」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/18008316/octave-matrix-of-discretized-legendre-polynomials