# Finding matrix of a linear transformation using R programing

The full question is: Let {u1, u2,···, un} and {x1, x2,···, xm} be bases for Rn and Rm respectively. Let T:Rn→Rm be the linear transformation whose associated matrix with respect to the above bases is A. Write a program in R such that given two sets of vectors{v1, v2,···, vn}and{w1, w2,···, wm}examines whether these two sets form basis for Rn and Rm respectively, and if so computes the new matrix which represents T with respect to the new bases

I am new to both R programing and linear algebra. I only know the basics of linear transformation. I do not understand how I can find the matrix representation since The function T is not defined. I also cannot understand how to take the input for the basis itself. Please help me understand how I can start with the program. Also, this is my first question so if you need any extra information or anything that I can provide please let me know.

basis=c("v1","v2","v3")

v1=c(1,2,3)

v2=c(4,3,2)

v3=c(9,4,6)

d=rbind(v1,v2,v3)

x=matrix(c(0,0,0), byrow=0)

solve(d,x)

     [,1]
[1,]    0
[2,]    0
[3,]    0


Is this how i can show that the vectors v1,v2,v3 are linearly independent? How can i show that they span the vector space?

• Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.
– Community Bot
Feb 28 at 14:40

The three vectors are linearly independent if the determinant of the matrix d you build is not zero. Solving a linear system with a zero right hand side is not the appropriate test.