<meter id="pryje"><nav id="pryje"><delect id="pryje"></delect></nav></meter>
          <label id="pryje"></label>

          新聞中心

          EEPW首頁 > 測試測量 > 設計應用 > LabVIEW MathScript開發(fā)算法:第二部分——MathScript 交互式窗口

          LabVIEW MathScript開發(fā)算法:第二部分——MathScript 交互式窗口

          作者: 時間:2017-01-06 來源:網(wǎng)絡 收藏



        1. 點擊Script標簽并點擊Load按鈕。選擇Mitra P2_1.m(Mitra, Sanjit and Kaiser, James H.,數(shù)字信號處理手冊Handbook for Digital Signal Processing[New York: John Wiley and Sons, 1993], 21)。該腳本生成一個測試信號并在該信號上應用滑動平均濾波器。
        2. 點擊Run按鈕來運行該腳本,將出現(xiàn)Prompt User for Input對話框。在Desired length of the filter=文本框中輸入正值并點擊OK按鈕。MathScript腳本可以包含交互式對話框來提示用戶輸入。
        3. 下方顯示的Mitra P2_1.m腳本,通過子繪圖命令,指定繪圖窗口(Plot window)內(nèi)4幅子圖(sub-plot)中的一幅。用戶指定子圖(sub-plot)后,后續(xù)命令隨即影響該子圖(sub-plot)。例如,當子繪圖命令結束后,繪圖命令可將其本身指定的繪圖裝入先前由子繪圖命令指定的子圖(sub-plot)。
        4. % Program P2_1
          % Simulation of an M-point Moving Average Filter
          % Generate the input signal
          n = 0:100;
          s1 = cos(2*pi*0.05*n); % A low-frequency sinusoid
          s2 = cos(2*pi*0.47*n); % A high frequency sinusoid
          x = s1+s2;
          % Implementation of the moving average filter
          M = input(Desired length of the filter = );
          num = ones(1,M);
          y = filter(num,1,x)/M;
          % Display the input and output signals
          clf;
          subplot(2,2,1);
          plot(n, s1);
          axis([0, 100, -2, 2]);
          xlabel(Time index n); ylabel(Amplitude);
          title(Signal #1);
          subplot(2,2,2);
          plot(n, s2);
          axis([0, 100, -2, 2]);
          xlabel(Time index n); ylabel(Amplitude);
          title(Signal #2);
          subplot(2,2,3);
          plot(n, x);
          axis([0, 100, -2, 2]);
          xlabel(Time index n); ylabel(Amplitude);
          title(Input Signal);
          subplot(2,2,4);
          plot(n, y);
          axis([0, 100, -2, 2]);
          xlabel(Time index n); ylabel(Amplitude);
          title(Output Signal);
          axis;

          本文引用地址:http://www.ex-cimer.com/article/201701/337021.htm

          您可以使用Command Window文本框來找出更多命令信息。利用在Command Window文本框中鍵入help subplot,該命令的描述以及語法信息、輸入、輸出和示例將會出現(xiàn)在Output Window中。



          上一頁 1 2 下一頁

          關鍵詞: LabVIEWMathScript開發(fā)算法交互式窗

          評論


          相關推薦

          技術專區(qū)

          關閉
          看屁屁www成人影院,亚洲人妻成人图片,亚洲精品成人午夜在线,日韩在线 欧美成人 (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })();