继续上题,为了程序编写简洁,要给数据框x中的6列重新命名为x1,x2,x3,x4,x5,x6,应该使用的命令是()
A: ColNames(x) <- c("x1","x2","x3","x4","x5","x6")
B: Names(x) <- c("x1","x2","x3","x4","x5","x6")
C: colnames(x) <- c("x1","x2","x3","x4","x5","x6")
D: colname(x) <- c("x1","x2","x3","x4","x5","x6")
A: ColNames(x) <- c("x1","x2","x3","x4","x5","x6")
B: Names(x) <- c("x1","x2","x3","x4","x5","x6")
C: colnames(x) <- c("x1","x2","x3","x4","x5","x6")
D: colname(x) <- c("x1","x2","x3","x4","x5","x6")
举一反三
- 假设有一幅4列4行的数字图像(左图),邻域窗口大小为3列3行,经多样性统计之后,右图中的B应分别为何值:2 5 3 4 x x x x4 3 1 2 x x B x6 7 5 3 x x x x1 3 5 4 x x x x A: 3 B: 4 C: 5 D: 6
- 已知数据x1,x2,x3,x4,x5的平均数为a,则数据4x1,4x2,4x3,4x4,4x5的平均数为______;4x1-2,4x2-2,4x3-2,4x4-2,4x5-2的平均数为______.
- 求函数 f(x)=3*x1^2 + 2*x1*x2 + x2^2 − 4*x1 + 5*x2. 时,输入代码 >>fun = @(x)3*x(1)^2 + 2*x(1)*x(2) + x(2)^2 - 4*x(1) + 5*x(2); >>x0 = [1,1]; >>[x,fval] = fminunc(fun,x0); 其中fun的作用是:
- 设函数f(x)=(x2-6x+c1)(x2-6x+c2)(x2-6x+c3),集合M={x|f(x)=0}={x1,x2,x3,x4,x5}?N*,设c1≥c2≥c3,则c1-c3=( ) A: 6 B: 8 C: 2 D: 4
- 求函数 f(x)=3*x1^2 + 2*x1*x2 + x2^2 − 4*x1 + 5*x2. 时,输入代码 >>fun = @(x)3*x(1)^2 + 2*x(1)*x(2) + x(2)^2 - 4*x(1) + 5*x(2); >>x0 = [1,1]; >>[x,fval] = fminunc(fun,x0); 到matlab上运行一下,得到的结果,x是: