
3 Graphics
Modifying the Graph Data Source
You can link graph data to variables in your workspace. When you change
the values contained in the variables, you can then update the graph to use
thenewdatawithouthavingtocreateanewgraph. (Seealsothe
refresh
function.)
1 Define 50 points between -3π and 3π and compute their sines and cosines:
x = linspace(-3*pi,3* pi,50);
ys = sin(x);
yc = cos(x);
2 Using the plotting tools, create a graph of ys = sin(x):
figure
plottools
3 In the Figure Palette, alternate-click to sele ct x and ys in the Variable pane.
4 Right-click either selected variable and choose plot(x, ys) from the context
menu, as shown belo w.
The res ulting plot looks like this.
3-32
Commenti su questo manuale