# Elements are arranged sequentially by row:
M <- matrix(c(3:14), nrow = 4, byrow = TRUE)
print("Matrix M:")
print(M)

sqrtm = sqrt(M)
print("sqrtm:")
print(sqrtm)

# Elements are arranged sequentially by column.
N <- matrix(c(3:14), nrow = 4, byrow = FALSE)
print("Matrix N:")
print(N)

# Define the column and row names.
rownames = c("row1", "row2", "row3", "row4")
colnames = c("col1", "col2", "col3")

P <- matrix(c(3:14),nrow = 4,byrow = TRUE,dimnames = list(rownames,colnames))
print("Matrix P:")
print(P)

