matlab plot y 1,Matlab 画图(1)

如何把matlab画图窗口的背景颜色设置为白色?

set(0,'defaultfigurecolor','w')

Fig1.摩擦系数变化曲线

x=0:0.2:1;

y=[

0 0 0 0;

0.58 0.31 0.18 0.08;

0.83 0.56 0.36 0.19;

1.14 0.89 0.62 0.30;

1.56,1.23 0.78 0.36;

2.08 1.52 0.99 0.49;

]

plot(x,y);

3b1599953699dc7fccc62f1b5a219b30.png

Fig2.正弦图形

x = linspace(0,2*pi,100);

y1 = sin(x);

y2 = sin(x+pi/4);

y3 = sin(x-pi/4);

plot(x,y1,x,y2,x,y3);

56a262bc3725d1eb17744b909975426b.png

Fig3.正弦余弦图形

clear;clc;clf;

x1=linspace(0,2*pi,100);

x2=x1-pi/4;

y1=sin(x1);

y2=5*cos(x2);

plot(x1,y1,x2,y2);

178a4eca7aaf5eb2abdf8b128cae6bed.png

Fig4.数据点图形

22b1496e8c28cbc3b1d37da5dfa5ecf0.png

x=0:pi/10:2*pi;

y1=sin(x);

y2=cos(x);

y3=x;

y4=x.^2;

hold on;

plot(x,y1,'r*');

plot(x,y2,'kp');

plot(x,y3,'bd');

plot(x,y4,'g:');

hold off;

8db2541d1a478e6f79494f442684a6d3.png

Fig5.图形的重叠

N = 9;

t = 0:2*pi/N:2*pi;

x = sin(t);y = cos(t);

tt = reshape(t,2,(N+1)/2);

tt = flipud(tt);

tt = tt(:);

xx=sin(tt);yy=cos(tt);

plot(x,y);

hold on;

plot(xx,y);

6c1ff71df34be09dc3852fcd2d005b0b.png

hold off;

plot(xx,y);

546510ee5febf0a3308b1741ef19cd01.png

Fig6.曲线属性的设置

a1e42b3d8f4a8e0fcf12eaf665de2fed.png

t = (0:pi/100:pi)';

y1 = sin(t)*[1,-1];

y2 = sin(t).*sin(9*t);

t3 = pi*(0:9)/9;

plot(t,y1,'r:',t,y2,'-bo');

hold on;

93f3b335e695cc291828be117818ffbe.png

hold on;

y3 = sin(t3).*sin(9*t3);

plot(t3,y3,'s','MarkerSize',10,'MarkerEdgeColor',[0,1,0],'MarkerFaceColor',[1,0.8,0]);

eeb483776ed6b05a7464f4d06c7e1ec8.png

Fig7.plot作图

x=-pi:pi/10:pi;

y1=exp(sin(x));

y2=exp(cos(x));

y3=exp(sin(x)+cos(x));

y4=exp(sin(x)-cos(x));

y5=0.2*exp(sin(x).*cos(x));

y6=0.2*exp(sin(x).\cos(x));

plot(x,y1,'b:',x,y2,'d-',x,y3,'m>:',x,y4,'rh-',x,y5,'gh-',x,y6,'bh-');

9073d988ec8ec8348bf9eab6ba7393eb.png

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值