/DOC/UAFWLIS Manual Example/Ex5/plotting_S11.m

http://ua-fwlis.googlecode.com/ · MATLAB · 81 lines · 56 code · 9 blank · 16 comment · 1 complexity · 1f58982306152327faa5dab0cbde14d3 MD5 · raw file

  1. %m-file used to plot S11
  2. clear all;close all;clc
  3. set(0,'defaultaxesfontsize',15);
  4. flag=input('Please enter 1 first and 2 then:');
  5. if flag==1
  6. s11=load ('OUTPUT_S11.dat');
  7. s12=load ('OUTPUT_S12.dat');
  8. temp='S11_UA';
  9. Out2File(s11,temp)
  10. temp='S12_UA';
  11. Out2File(s12,temp)
  12. else
  13. S11_UA=load('S11_UA.txt');
  14. S12_UA=load('S12_UA.txt');
  15. S11_HFSS=load('S11_HFSS.txt');
  16. S12_HFSS=load('S12_HFSS.txt');
  17. % % HFSS_2=load('.\ex1\ExamS11_2.txt');
  18. % % HFSS_P2=load('.\ex1\ExamPhaseS11_2.txt');
  19. %
  20. % S_ADS=load('ADS_2.txt');
  21. % % %%% Frequency
  22. % F_ADS=S_ADS(:,1)/10^9;
  23. % % for p=1:length(s);
  24. % % Pmn(p)=p;
  25. % % aa(p)=s(p,1);
  26. % % bb(p)=s(p,2);
  27. % % cc(p)= s(p,3);
  28. % % end
  29. % %F=4:0.1:25;
  30. S11_ADS=load('Ex5_S11_ADS.txt');
  31. PhS11_ADS=load('Ex5_PhS11_ADS.txt');
  32. S12_ADS=load('Ex5_S12_ADS.txt');
  33. PhS12_ADS=load('Ex5_PhS12_ADS.txt');
  34. %
  35. figure(1);
  36. plot (S11_UA(:,1),S11_UA(:,3),'b','linewidth',2);
  37. xlabel('Frequency (GHz)')
  38. ylabel('S11 Phase(degree)')
  39. grid on;hold on;
  40. plot(S11_HFSS(:,1),S11_HFSS(:,3),'-.r','linewidth',2)
  41. plot(PhS11_ADS(:,1)/1e9,PhS11_ADS(:,2),'--k','linewidth',2)
  42. legend('UA-FWLIS','HFSS','ADS')
  43. axis([5 12 -200 200]);
  44. %pause;
  45. figure(2);
  46. plot (S11_UA(:,1),S11_UA(:,2),'b','linewidth',2);
  47. xlabel('Frequency (GHz)')
  48. ylabel('S11 Magnitude (dB)')
  49. grid on;hold on;
  50. plot(S11_HFSS(:,1),S11_HFSS(:,2),'-.r','linewidth',2)
  51. plot(S11_ADS(:,1)/1e9,S11_ADS(:,2),'--k','linewidth',2)
  52. legend('UA-FWLIS','HFSS','ADS')
  53. axis([5 12 -20 0])
  54. figure(3);
  55. plot (S12_UA(:,1),S12_UA(:,3),'b','linewidth',2);
  56. xlabel('Frequency (GHz)')
  57. ylabel('S12 Phase(degree)')
  58. grid on;hold on;
  59. plot(S12_HFSS(:,1),S12_HFSS(:,3),'-.r','linewidth',2)
  60. plot(PhS12_ADS(:,1)/1e9,PhS12_ADS(:,2),'--k','linewidth',2)
  61. legend('UA-FWLIS','HFSS','ADS')
  62. axis([5 12 -200 200])
  63. figure(4);
  64. plot (S12_UA(:,1),S12_UA(:,2),'b','linewidth',2);
  65. xlabel('Frequency (GHz)')
  66. ylabel('S12 Magnitude (dB)')
  67. grid on;hold on;
  68. plot(S12_HFSS(:,1),S12_HFSS(:,2),'-.r','linewidth',2)
  69. plot(S12_ADS(:,1)/1e9,S12_ADS(:,2),'--k','linewidth',2)
  70. legend('UA-FWLIS','HFSS','ADS')
  71. axis([5 12 -100 0])
  72. end