To compute the column vector v storing the square of each element of the vector x in Matlab, first we need to create the vector x by solving the system of linear equations Ax = b, where A is the matrix given and b is the vector given.
We can do this in Matlab using the backslash operator as follows:
79 chars4 lines
Next, we can square each element of x using element-wise multiplication and store the result in a new column vector v:
39 chars2 lines
The resulting vector v will store the square of each element of x.
gistlibby LogSnag