createfigure.m

来自「这是书籍:Matlab控制系统与应用的源码,」· M 代码 · 共 40 行

M
40
字号
function createfigure(x1, y1)
%CREATEFIGURE(X1,Y1)
%  X1:  vector of x data
%  Y1:  matrix of y data
 
%  Auto-generated by MATLAB on 09-Dec-2007 20:32:48
 
%% Create figure
figure1 = figure(...
  'FileName','F:\博士论文\matlab程序\演示\fig5.fig',...
  'PaperPosition',[0.6345 6.345 20.3 15.23],...
  'PaperSize',[20.98 29.68]);
 
%% Create axes
axes1 = axes(...
  'FontSize',11,...
  'FontWeight','bold',...
  'XGrid','on',...
  'YGrid','on',...
  'Parent',figure1);
xlim(axes1,[0 10]);
xlabel(axes1,'t/s');
ylabel(axes1,'y');
box(axes1,'on');
hold(axes1,'all');
 
%% Create multiple lines using matrix input to plot
plot1 = plot(x1,y1);
set(plot1(1),...
  'LineStyle','--',...
  'LineWidth',2);
set(plot1(2),'LineWidth',2);
 
%% Create legend
legend1 = legend(...
  axes1,{'Logic','data2'},...
  'FontSize',11,...
  'FontWeight','bold');
 

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?