📄 ex2301.m
字号:
%例23-1 MATLAB绘图函数实例
function createfigure(x1, y1)
%CREATEFIGURE(X1,Y1)
% X1: vector of x data
% Y1: matrix of y data
% Auto-generated by MATLAB on 16-Feb-2006 14:38:25
%% Create figure
figure1 = figure('PaperPosition',[0.6345 6.345 20.3 15.23],'PaperSize',[20.98 29.68]);
%% Create axes
axes1 = axes('Parent',figure1);
axis(axes1,[0 6.283 -2 2]);
title(axes1,'sin(x)/sin(2x)/sin(3x)');
xlabel(axes1,'x');
ylabel(axes1,'y');
box(axes1,'on');
hold(axes1,'all');
%% Create multiple lines using matrix input to plot
plot1 = plot(x1,y1);
%% Create text
text1 = text(...
'Position',[1.136 -0.9532 0],...
'String','y=sin(x)',...
'VerticalAlignment','baseline',...
'Parent',axes1);
%% Create text
text2 = text(...
'Position',[2.266 -0.8947 0],...
'String','y=sin(2x)',...
'VerticalAlignment','baseline',...
'Parent',axes1);
%% Create text
text3 = text(...
'Position',[3.395 0.8947 0],...
'String','y=sin(3x)',...
'VerticalAlignment','baseline',...
'Parent',axes1);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -