To define each vector vi = [fi(x)]b as a coordinate vector relative to the basis b in p4, you can use the following steps in MATLAB:
b
that represents the basis elements {1, x, x^2, x^3, x^4}.v1
and v2
as column vectors using the coordinate vector representation.Here's the MATLAB code to accomplish this:
main.m425 chars12 lines
In this code, subs(f, x, b{i})
is used to substitute the basis element b{i}
into the polynomial function f
. The resulting value is then added to the coordinate vector v1
or v2
.
Now, v1
and v2
are column vectors in MATLAB representing the coordinate vectors of f1(x)
and f2(x)
relative to the basis b
in p4.
gistlibby LogSnag