Matlab Plot Figure Guide
In Matlab, you can use the figure function to create a new plot window and the plot function to plot graphs in the specified window. Here is an example code:
% 创建一个新的图形窗口
figure(1);
% 绘制图形
x = 0:0.1:2*pi;
y = sin(x);
plot(x, y);
title('Sine Function');
xlabel('x');
ylabel('sin(x)');
% 创建另一个新的图形窗口
figure(2);
% 绘制另一个图形
x = -5:0.1:5;
y = x.^2;
plot(x, y);
title('Quadratic Function');
xlabel('x');
ylabel('x^2');
In the example code above, a new plot window was created using figure(1) to draw the graph of the sine function, and another plot window was created using figure(2) to draw the graph of a quadratic function. This allows for drawing different graphs in separate plot windows.