我想绘制一个简单的函数,但我无法弄清楚如何去做。PyPlot和Julia无法绘制x^2
此代码工作正常
using PyPlot
x = linspace(0,10,1000); y = log(x);
plot(x, y, color="blue", linewidth=2.0, linestyle="-")
但接下来的代码不工作
using PyPlot
x = linspace(0,10,1000); y = x^2;
plot(x, y, color="blue", linewidth=2.0, linestyle="-")
我无法弄清楚如何通过X乘以X。
谢谢,什么是元素?是否有效3. * 4'? – exsnake
@exsnake官方文档简要讨论[元素操作](http://docs.julialang.org/en/release-0.5/manual/mathematical-operations/?highlight=elementwise)。我不知道'3. * 4''是什么意思。这会起作用,但是编写'12'看起来过于复杂。 –
这只是一个愚蠢的例子。我想说的是在不是数组的变量中使用它。 – exsnake