我想多次绘制一个函数,每次都更改函数中的参数(常量)。我怎么能这样做?
fun1 <- function(x, b) abs(x^2 - b^2)
plot(fun1(b=0.1),-1, 1)
plot(fun1(b=0.2),-1, 1, add=TRUE)
答案 0 :(得分:2)
相同的方法只是在var dataString = $('#Form_Name').serializeArray();
txtCalrev_list = '';
$.each(dataString, function (i, field) {
if (field.name.indexOf('txt') == 0)
txtCalrev_list = txtCalrev_list + (field.value + "_" + field.name + ",");
});
alert(txtCalrev_list);
:
for-loop
答案 1 :(得分:1)
试试这个:
curve(abs(x^2 - 0.1^2), -1, 1)
curve(abs(x^2 - 0.2^2), -1, 1, add = TRUE)