首页 > 其他分享 >matlab figure

matlab figure

时间:2022-11-28 18:34:33浏览次数:36  
标签:subplot 10 figure rand 0.5 flag matlab sin

figure
subplot(2,3,1)
ezplot(@sin)
xlabel('time')
ylabel('sin')
subplot(2,3,5)
ezplot(@cos)
subplot(2,3,[3,6])
subplot(2,4,[3,8])
y=round(rand(5,3)*10)

y =

     8     1     2
     9     3    10
     1     5    10
     9    10     5
     6    10     8

subplot(1,2,1)
bar(y)
set(gca,'xticklabel',{'A','B','C1','D2','E'})
subplot(1,2,2)
bar(y,0.5)
bar(y,'stacked')
h=bar(y,'stacked');
set(h(1),'facecolor','m','edgecolor','k','linewidth',2)
set(h(2),'facecolor','g','linestyle','none')
bar3(y)

x= [2,4,8,1,0.5];
pie(x)
flag=[0,0,1,0,0];
pie(x,flag)
flag=[0,0,1,0,1];
pie(x,flag)
pie3(x,flag)
x=0:0.5:2*pi;
y=sin(x);
area(x,y)
h=area(x,y);
h.FaceColor ='r';
h.EdgeColor ='m';
h.LineWidth =3;
x=[2,4,5,1];
y=[4,5,2,1];
fill(x,y,'g')
x=0:0.5:2*pi;
y1=sin(x)+2;
y2=cos(x)-2;
xfill=[x,fliplr(y)];
xfill=[x,fliplr(x)];
yfill=[y1,fliplr(y)];
yfill=[y1,fliplr(y2)];
fill(xfill,yfill,'r')
z=normrnd(0,100,1000,1);
hist(z)
hist(z,[-300:20:-40,-20:5:20,40:20:300])
% Kuroshio.mat
y=rand(1000,1)*2*pi;
rose(y)

v=rand(144,1)*10+5;
u=rand(144,1)*10-5;
ang=atan(v./abs(u));
ang(u<0)=pi-ang(u<0);
rose(ang)


clear
% load seamount.mat
% h =scatter(x,y,5,z);
% colorbar
% h.Maker='v';
% h =scatter(x,y,5,z,'filled');
% load penny.mat
x=linspace(1,10,128);
y=x;
% contour(x,y,P)
% contour(x,y,flipud(P),60)
% axis square;colormap('copper')
clear
[x,y]=meshgrid(-2:0.2:2,-3:0.2:2);
z=x.*exp(-x.^2-y.^2);
[c,h]=contour(x,y,z);
clabel(c,h)
[c,h]=contourf(x,y,z);
[c,h]=contourf(x,y,z,20);
colormap('spring')
colorbar
[c,h]=contourf(x,y,z,20);
ap('autumn')
colormap('jet')
caxis([-0.4,0.4])
pcolor(x,y,z)
shading flat
shading interp
colorbar
[dx,dy]=gradient(z);
[dx,dy]=gradient(z,0.2,0.2);
contour(x,y,z)
hold on
quiver(x,y,dx,dy)
hold off
x=0:0.5:2*pi;
u=sin(x);
v=cos(x);
feather(u,v)

[x,y]=meshgrid(-2:0.2:2,-3:0.2:2);
surf(x,y,z)
shading flat
shading interp
surfc(x,y,z)
mesh(x,y,z)
meshc(x,y,z)
set(gcf,'PaperPositionMode','auto')
print('-djpeg','-r300','fig1')
print('-dtiff','-r300','fig1')
print('-dpdf','fig1')

  

标签:subplot,10,figure,rand,0.5,flag,matlab,sin
From: https://www.cnblogs.com/physical-oceanography/p/16932988.html

相关文章

  • 基于MATLAB的COST231 Hata信道模型的仿真与理论分析
    COST231Hata模型应用频率在1500MHz到2000MHz之间,适用于小区半径大于1km的宏蜂窝系统,发射有效天线高度在30m到200m之间,接收有效天线高度在1m到10m之间。路径损耗计算的经......
  • 基于窗函数的FIR滤波器的matlab设计与实现
    目录一、理论基础二、理论基础三、仿真测试结果一、理论基础数字滤波器的设计是现代数字信号处理的重要内容。常用的数字滤波器有FIR和IIR两种类型,两者比较而言。主......
  • 基于切比雪夫逼近法的滤波器的matlab设计与实现
    目录一、理论基础二、核心程序三、仿真测试结果一、理论基础从FIR数字滤波器的系统函数可以看出,极点都是在Z平面的原点,而零点的分布是任意的。不同的分布对应不同的......
  • PropertyPlaceholderConfigurer、PropertyOverrideConfigurer等对属性配置文件Propert
    Spring的PropertyResourceConfigurer是个抽象类,继承自PropertiesLoaderSupport,并实现了接口BeanFactoryPostProcessor。注意:它是个Bean工厂的后置处理器,而不是Bean的后置......
  • 20220616 WebMvcConfigurer
    WebMvcConfigurer接口定义的方法方法影响WebMvcConfigurationSupport类中的@Bean方法描述configurePathMatchRequestMappingHandlerMappingrequestMappi......
  • 拓端tecdat|matlab代写使用VMD(变分模态分解)
    matlab中使用VMD(变分模态分解)拨号音信号的变模分解创建一个以4kHz采样的信号,类似于拨打数字电话的所有键。将信号另存为MATLAB®时间数据。fs=......
  • matlab中histc的用法
    https://blog.csdn.net/weixin_41107577/article/details/103594881定义矩阵:ages=[3,12,24,15,5,74,23,54,31,23,64,75];binranges=[0,10,25,50,75];[bincounts,i......
  • matlab-如何计算信噪比
    Matlab信号上叠加噪声和信噪比的计算在信号处理中经常需要把噪声叠加到信号上去,在叠加噪声时往往需要满足一定的信噪比,这样产生二个问题,其一噪声是否按指定的信噪比叠加,其二......
  • 【TSP-GA】基于MATLAB的TSP-GA问题优化仿真
    1.软件版本MATLAB2021a2.核心代码functionvarargout=tspo_ga(varargin)%InitializedefaultconfigurationdefaultConfig.xy=10*rand(50,2);......
  • 【信道估计】LS/MMSE信道估计,CS信道估计的MATLAB仿真
    1.软件版本MATLAB2021a2.本算法理论知识构造测量矩阵是压缩感知技术中关键的研究方向之一,在实现压缩的过程中需要构建一个满足RIP法则的特殊矩阵来保证较高的重构精度......