第 1 页,共 2 页12

surf线型、颜色的设置方法

surf函数在画数据点比较密集的图像时,往往边缘线占了主要部分。显示的图像往往是黑色的色块,让人无法忍受。 通过两种方法可以对线型或者颜色进行修改。 1、直接修改 surf(t,’lineStyle’,’none’); %无边线 或者 surf(t,’edgecolor’,’none’); %边线无颜色 2、显示后进一步修改属性 h = surf(a); set(h, ‘edgecolor’,’none’); 不只是surf函数,其他显示函数的属性修改方法完全类似。

信号fft的matlab程序

clear %编写骆遥 fs=1000 t=0:1/fs:0.6; f1=100; f2=300; x=sin(2*pi*f1*t)+sin(2*pi*f2*t); subplot(711) plot(x); title(‘f1(100Hz)\f2(300Hz)的正弦信号,初相0′) xlabel(‘序列(n)’) grid on number=512 y=fft(x,number); n=0:length(y)-1; f=fs*n/length(y); subplot(713) plot(f,abs(y)); title(‘f1\f2的正弦信号的FFT(512点)’) xlabel(‘频率Hz’) grid on x=x+randn(1,length(x)); subplot(715) plot(x); title(‘原f1\f2的正弦信号(含随机噪声)’) xlabel(‘序列(n)’) grid on y=fft(x,number); n=0:length(y)-1; f=fs*n/length(y); subplot(717) plot(f,abs(y)); title(‘原f1\f2的正弦信号(含随机噪声)的FFT(512点)’) xlabel(‘频率Hz’) grid on

matlab的plot基本应用说明

老外讲的挺清楚。 To create XY graphs, it is easiest to form your data into two row vectors, one for the x co-ordinates, and one for the y co-ordinates.  The command plot(x,y) will then create a figure with points at each y value for each matching x value.  You can control the style of any line drawn [...]

Matlab 画图函数plot的线形颜色使用说明

  plot函数可以接一些参数,来改变所画图像的属性(颜色,图像元素等)。线形颜色 颜色: b     blue(蓝色)                 g     green(绿色) r     red(红色)            c     cyan(墨绿色) m     magenta(紫红色) y     yellow(黄色) k     black(黑色) 线形: .     point(点) -     solid(实线) o     circle(圆圈)    :     dotted(点线) x     x-mark(叉号)    -.    dashdot (点画线) +     plus(加号)       –    dashed(虚线)  *     star(星号)      (none)  no lines   %没弄清楚!!!!!  s     square(正方形)    d     diamond(菱形) v     triangle (down) ^     triangle (up) <     triangle (left) >     [...]

Matlab画图中关于自定义坐标

plot函数自定义坐标系。 x=sin(1:0.3:4); subplot(3,2,1) plot(x) title(‘默认格式’) subplot(3,2,2) plot(x) set(gca,’xtick’,[1 3 6 8]); set(gca,’ytick’,[]); title(‘X自定义间隔,Y关闭’) subplot(3,2,3) plot(x) set(gca,’xtick’,[1 3 6 8]); set(gca,’xticklabel’,sprintf(‘%03.4f|’,get(gca,’xtick’))) set(gca,’ytick’,[2 4 5 7]); set(gca,’yticklabel’,{‘Two’,’Four’,’Five’,’Seven’}); title(‘XY自定义间隔、精度及显示方式’) subplot(3,2,4) plot(x) set(gca,’xminortick’,’on’);%style 5 set(gca,’ticklength’,[0.05 0.025]); set(gca,’tickdir’,’out’); title(‘XY坐标刻度显示方式’) subplot(3,2,5) plot(x) set(gca,’xtick’,[min(x) (max(x)+min(x))/2 max(x)]); set(gca,’ytick’,[min(x) (max(x)+min(x))/2 max(x)]); title(‘论文中常用的标准3点式显示’) x=20:10:20000; y=rand(size(x)); subplot(3,2,6) semilogx(x,y); set(gca,’XLim’,[20 20000]); set(gca,’XMinorTick’,’off’); set(gca,’XTick’,[20 31.5 63 125 250 [...]

Matlab图像文件读取、保存、转换的实现

本文是从我以前的博客里转过来的。是原创文章。 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % 实现功能:matlab % 1、批量读取图像文件:BMP/GIF/JPG; % 2、调用系统命令:如创建文件夹 mkdir; % 3、批量读取文件信息; % 4、保存图像文件。 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% clear; %清除变量 clc;    %清除屏幕 fileFolder=’E:\\work\\railway\\test\\2\\’; %设置文件夹路径 fileType=’*.bmp’;                           %设置文件变量 % filename=sprintf(‘img%3d’,12) fprintf(['getting file list within folder :',fileFolder,'(file type:)',fileType,'...\n\n']);           %输出提示信息    picstr=dir([fileFolder,fileType]);      %获取相应文件信息 [row,col]=size(picstr);                 %获取文件数量row fprintf(['creating gray image folder:',fileFolder,'gray\\...\n']);           %输出提示信息    system(['mkdir ',fileFolder,'gray\\']); %调用系统命令 mkdir,创建文件夹 for i=1:row     fprintf(['\nreading ',picstr(i).name,'...\n']);             %输出载入信息     video_rgb(:,:,:,i)=imread([fileFolder,picstr(i).name]);     %载入图像     [...]