• 大小: 66.58MB
    文件类型: .7z
    金币: 1
    下载: 0 次
    发布日期: 2022-01-11
  • 语言: Matlab
  • 标签: MATLAB  

资源简介

MATLAB2017a的中文文档,之前因为上传权限问题分开为三个文件,现在权限够了合成一个文件

资源截图

代码片段和文件信息

function fftgui(x)
%FFTGUI  Demonstration of Finite Fourier Transform.
%  FFTGUI(x) plots real(x) imag(x) real(fft(x)) and imag(fft(x)).
%  FFTGUI without any arguments uses x = zeros(132).
%  When any point is moved with the mouse the other plots respond.
%
%  Inspired by Java applet by Dave Hale Stanford Exploration Project
%     http://sepwww.stanford.edu/oldsep/hale/FftLab.html

if nargin == 0
   % Default initial x is all zeros.
   x = zeros(132);
end
if ~isempty(x)
   if isequal(x‘reset‘)
      % Restore original data
      x = get(0‘userdata‘);
      set(gcf‘userdata‘x);
      set(findobj(‘tag‘‘fftguirc‘)‘string‘‘close‘ ...
         ‘callback‘‘close(gcf)‘)
   else
      % Save input data.
      x = x(:)‘;
      set(0‘userdata‘x);

      % Initialize figure.
      clf reset
      set(gcf ...
        ‘doublebuffer‘‘on‘ ...
        ‘name‘‘FFT gui‘ ...
        ‘menu‘‘none‘ ...
        ‘numbertitle‘‘off‘ ...
        ‘userdata‘x ...
        ‘units‘‘normalized‘ ...
        ‘pos‘[.05 .25 .90 .65] ...
        ‘doublebuffer‘‘on‘ ...
        ‘windowbuttondownfcn‘ ...
        ‘fftgui([]); set(gcf‘‘windowbuttonmotionfcn‘‘‘‘fftgui([])‘‘)‘ ...
        ‘windowbuttonupfcn‘ ...
        ‘set(gcf‘‘windowbuttonmotionfcn‘‘‘‘‘‘)‘)
      uicontrol(‘tag‘‘fftguirc‘‘string‘‘close‘‘callback‘‘close(gcf)‘);
   end
   
   % Initialize four subplots

   n = length(x);
   idx = 1:n;
   y = fft(x);
   
   subplot(221)
   u = real(x);
   plot([0 n+1][0 0]‘k-‘ [idx;idx][0*u;u]‘c-‘ idxu‘b.‘‘markersize‘16)
   axis([0 n+1 -1 1])
   set(gca‘xtick‘[])
   set(gca‘ytick‘[])
   title(‘real(x)‘‘fontname‘‘courier‘‘fontweight‘‘bold‘)
   
   subplot(222)
   u = imag(x);
   plot([0 n+1][0 0]‘k-‘ [idx;idx][0*u;u]‘c-‘ idxu‘b.‘‘markersize‘16)
   axis([0 n+1 -1 1])
   set(gca‘xtick‘[])
   set(gca‘ytick‘[])
   title(‘imag(x)‘‘fontname‘‘courier‘‘fontweight‘‘bold‘)
   
   subplot(223)
   u = real(y);
   plot([0 n+1][0 0]‘k-‘ [idx;idx][0*u;u]‘c-‘ idxu‘b.‘‘markersize‘16)
   axis([0 n+1 -2 2])
   set(gca‘xtick‘[])
   set(gca‘ytick‘[])
   title(‘real(fft(x))‘‘fontname‘‘courier‘‘fontweight‘‘bold‘)
   
   subplot(224)
   u = imag(y);
   plot([0 n+1][0 0]‘k-‘ [idx;idx][0*u;u]‘c-‘ idxu‘b.‘‘markersize‘16)
   axis([0 n+1 -2 2])
   set(gca‘xtick‘[])
   set(gca‘ytick‘[])
   title(‘imag(fft(x))‘‘fontname‘‘courier‘‘fontweight‘‘bold‘)
  
else

   % Respond to mouse motion.
   x = get(gcf‘userdata‘);
   n = length(x);
   pt = get(gcf‘currentpoint‘);
   pos = get(gca‘pos‘);
   p = round((n+1)*(pt(1)-pos(1))/pos(3));
   q = 2*(pt(2)-pos(2))/pos(4)-1;
   inplot = 1 + (pt(1)>.5) + 2*(pt(2)<.5);
   if (p > 0) && (p < n+1) && (abs(q) <= 1)
      switch inplot
         case 1 
            x(p) = q+i*imag(x(p));
            y = fft(x);
         case 2 
            x(p) = real(x(p))+i*q;
            y = fft(x);
         case 3
            y = fft(x);
            y(p) = 2*q+i*imag(y(p));
          

评论

共有 条评论