TCS Ievolve competncy ID - 5337 - Data Science
E0- Fresco Play Hands on - R basics - 3 Vectors and Matrices
Ievolve course ID - 55101
question -
1. Create a vector V with values 1 to 9
2. Create a 3X3 matrix M using the vector V (Set parameter byrow = TRUE)
3. Multiply all the elements in the matrix by 2
4. Print the result matrix
Answer -
v = 1:9
m = matrix(v,nrow=3,byrow=TRUE)
M= m*2
M
0 Comments