簡體   English   中英

mathcad / matlab傳遞函數的3D圖

[英]mathcad / matlab 3D plot of transfer function

我在繪制傳遞函數的3D圖時遇到問題。 在matlab中,我嘗試了以下方法:

 [T,w] = meshgrid(1:1:32,1:1:100);
sys2=20*log((1-w.*(T./2)./w.*T).*(((2.56.*(w.^2)+1.6.*w+1)./(0.0008.*(w.^6)+0.0124.* (w.^5)+0.173.*(w.^4)+(w.^3)))./1+(((2.56.*(w.^2)+1.6.*w+1)./(0.0008.*(w.^6)+0.0124.*(w.^5)+0.173.*(w.^4)+(w.^3))))));
 surf(T,w,sys2);

但是我得到這個錯誤:

  ??? Error using ==> surf at 78
  X, Y, Z, and C cannot be complex.

請問可能有什么問題嗎? 或者有人可以告訴我如何在Mathcad中進行繪制嗎? 謝謝。

您無法針對兩個獨立變量繪制一個復數-您將需要四個軸。

您可以做的是:

  1. 使用兩個單獨的圖形(或同一圖形中的兩個子圖)繪制實部和虛部。 在Matlab中

     surf(T,w,real(sys2)); figure %// create new figure for the other graph surf(T,w,imag(sys2)); 
  2. 或者,繪制絕對值和相位:

     surf(T,w,abs(sys2)); figure %// create new figure for the other graph surf(T,w,angle(sys2)); 
  3. 在同一張圖中,更奇特的可能性是將z軸用作絕對值,將顏色用作相位:

     surf(T,w,abs(sys2),angle(sys2)); %// fourth argument of surf specifies colour 

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM