MATLAB: Creating a coefficient matrix for a polynomial

coefficient matrixMATLABmatrixpolynomialsymbolic

I have a function f(x) = a_0 +a1*x+a2*x^2+a3*x^3
I need to create a matrix such that
row 1 contains f(0) term as first element and other terms as 0 0 0
row 2 is coefficients of differentiation of f(x) at 0 which would be 0 1 0 0
row 3 is coefficients of f(x) at x = L i.e [1 L L^2 L^3]

Best Answer

Adding to Walter comment you can also try creating required matrix leveraging syms , coeffs , diff.