
3 Graphics
Providing New Values for the Data Source
MATLAB copies the data that defines the graph from variables in the base
workspace (for e xample,
x and y)totheXData and YData properties of the
plot object (for example, a lineseries). Therefore, in addition to being able to
choose new data sources, you can assign new values to workspace variables
in the Command Window and click the Refresh Data button to update a
graph to use the new data.
x = linspace(-pi,pi,5 0); % Define 50 points between -π and π
y = sin(x);
area(x,y) % Make an area plot of x and y
3-34
Komentáře k této Příručce