Q:

Write a R program to create a blank matrix

0

Write a R program to create a blank matrix.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

m = matrix(, nrow = 10, ncol = 5)
print("Empty matrix of 10 rows and 5 columns:")
print(m)

Sample Output:

[1] "Empty matrix of 10 rows and 5 columns:"
      [,1] [,2] [,3] [,4] [,5]
 [1,]   NA   NA   NA   NA   NA
 [2,]   NA   NA   NA   NA   NA
 [3,]   NA   NA   NA   NA   NA
 [4,]   NA   NA   NA   NA   NA
 [5,]   NA   NA   NA   NA   NA
 [6,]   NA   NA   NA   NA   NA
 [7,]   NA   NA   NA   NA   NA
 [8,]   NA   NA   NA   NA   NA
 [9,]   NA   NA   NA   NA   NA
[10,]   NA   NA   NA   NA   NA

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now