- 在线时间
- 0 小时
- 最后登录
- 2009-9-18
- 注册时间
- 2008-12-2
- 听众数
- 4
- 收听数
- 0
- 能力
- 0 分
- 体力
- 460 点
- 威望
- 38 点
- 阅读权限
- 40
- 积分
- 539
- 相册
- 1
- 日志
- 2
- 记录
- 1
- 帖子
- 33
- 主题
- 14
- 精华
- 0
- 分享
- 2
- 好友
- 29
升级   79.67% 该用户从未签到
 群组: flystar |
%一般函数作图基本处理技术
%clc;
clear;
close;
x=0:0.05:7;
y=sin(x);
plot(x,y);
axis([1,3,0,1]);pause(0.1);
axis('square');pause(0.1);
axis('equal');pause(0.1);
axis('normal');pause(0.1);
axis('xy');pause(0.1);
axis('ij');pause(0.1);
axis('on');pause(0.1);
axis('off');pause(0.1);
%改变y轴的标注点
set(gca,'ytick',[-1 -0.5 -0.4 -0.3 -0.2 -0.1 0 0.1...
0.15 0.2 0.3 0.4 0.5 1]);pause(0.1);
%以下三种方法效果相近
%set(gca,'xticklabel','yeah|he|jian|is|the|best');pause(0.1);
set(gca,'xtick',[1 1.5 1.8 2.0 2.5 2.8],'xticklabel','yeah|he|jian|is|the|best');pause(0.1);
%set(gca,'xtick',[0 0.2 0.6 0.8 1 1.5],'xticklabel',{'yeah','he','jian','is','the','best'});pause(0.1);
%以下三种方法注意区别
axis('on');pause(0.1);
set(gca,'Color','red');pause(0.1);
grid on;
text(2,0.5,'yeah,hejian is god.');pause(0.1);
set(gca,'DefaultTextColor','black');pause(0.1);
xlabel('\alpha \beta \epsilon \Delta \geq \surd \leftrightarrow');pause(0.1);
ylabel('\alpha \beta \epsilon \Delta \geq \surd \leftrightarrow \pm \Lambda \pm \cap \Pi \Sigma \perp');pause(0.1);
text(2.2,0.6,'\alpha \beta \epsilon \Delta \geq \surd \leftrightarrow');pause(0.1);
text(1.8,0.4,'\alpha \beta \epsilon \Delta \geq \surd \leftrightarrow \pm \Lambda \pm \cap \Pi \Sigma \perp');pause(0.1);
text(2.0,sin(2.0),'\leftarrow 这是过2.0点,h_{a^{n}}^{n}j^{n_{a}}_{a}');
%
%一般函数作图基本处理技术
%clc;
%二维绘图基本流程
clear;
close;
x1=0:0.02*pi:2*pi;
y1=[sin(x1);sin(2*x1);sin(3*x1)];
figure1=figure('paperposition',[0.6345 6.345 20.3 15.23],...
'papersize',[20.98 29.68]);%建立绘图区
axes1=axes('parent',figure1);%设立坐标轴模式
axis(axes1,[0 6.283 -2 2]);%建立坐标轴
title(axes1,'\it sin(x)/sin(2x)/sin(3x)','fontsize',36,'color','red');
xlabel(axes1,'x','fontsize',36,'color','red','fontweight','bold');
ylabel(axes1,'y','fontsize',36,'color','blue');
box(axes1,'on');
hold(axes1,'all');%设立坐标轴叠加模式
plot1=plot(x1,y1);
text1=text(...%创立文字标注
'position',[1.136 -0.9532 0],...
'string','y=sin(x)',...
'verticalalignment','baseline',...
'parent',axes1);
text2=text(...
'position',[2.266 -0.8947 0],...
'string','y=sin(2x)',...
'verticalalignment','baseline',...
'parent',axes1);
text3=text(...
'position',[3.395 0.8947 0],...
'string','y=sin(3x)',...
'verticalalignment','baseline',...
'parent',axes1);
text(1,1,['sin(\pi)+cos(\pi)=',num2str(2)]);
text(3,0,{'he jian','hello'});%文本换行输出处理方式
text(4,0,{'he jian';'hello'});%文本换行输出处理方式
gtext({'he','jian','hello'});%可以通过单击标注一个多行文本
gtext({'he';'jian';'hello';'duo wen ben'});%可以通过多次鼠标单击标注多个文本
hold(axes1,'off');
line([1 0],[0 1]);%二维折线绘制_可用与瞄边界或水平线
%二维图形的修饰
n=10;a=20;b=30;
plot(1:10,1:10);
text(5,5,int2str([n n 10 5 0]));
title(mat2str([a,b])); |
zan
|