summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbnewbold <bnewbold@robocracy.org>2014-04-22 22:00:10 -0400
committerbnewbold <bnewbold@robocracy.org>2014-04-22 22:00:10 -0400
commit222292b3aa9d967557c3165cce5cc7f5773c20ab (patch)
tree0dd29fee022b4186084593e64c27e4e5bfc045ab
parentdc65fcce38ad89549692696c3fc8f2265dbf981a (diff)
downloaddmmsb2014-222292b3aa9d967557c3165cce5cc7f5773c20ab.zip
dmmsb2014-222292b3aa9d967557c3165cce5cc7f5773c20ab.tar.gz
commit old graph example script
-rw-r--r--julia/graph_example.jl28
1 files changed, 28 insertions, 0 deletions
diff --git a/julia/graph_example.jl b/julia/graph_example.jl
new file mode 100644
index 0000000..e4d00d1
--- /dev/null
+++ b/julia/graph_example.jl
@@ -0,0 +1,28 @@
+
+# Trivial Winston plotting example
+
+using Winston
+
+a=20
+b=2
+c=5
+dt = 0.05
+tlast = 2
+iterations = int( round(tlast/dt) )
+xall = zeros(iterations, 1)
+x = c
+
+for i = 1:iterations
+ xall[i] = x
+ dxdt = a - b*x
+ x = x + dxdt*dt
+end
+
+time = dt * [0:iterations-1]'
+
+
+plot(time,xall)
+title("Horray!")
+xlabel("time")
+ylabel("y")
+