Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是否可以在 R 中绘制有理函数?例如:
curve(((x+2)*(x-5))/((x-3)*(x+1)), from=-8,to=9)给出不正确的图可能是因为函数不能在 x=-1 和 x=4
curve(((x+2)*(x-5))/((x-3)*(x+1)), from=-8,to=9)
非常感谢
R 似乎可以相当优雅地处理渐近爆炸:
curve( (x-5)*(x-3)/( (x+1)*(x-4) ), 3 ,5)
为了处理不连续的情况,n将“y”增加并替换为高于阈值的 NA。
n
vals <- curve( (x-5)*(x-3)/( (x+1)*(x-4) ), -3 ,5, n=1000) is.na(vals$y) <- abs(vals$y) > 100 plot(vals, type="l")