Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function [ f, Zin ] = funkce( fileName, isGrid, lineWidth )
- profile clear;
- profile on;
- if (nargin < 2)
- isGrid = true;
- end;
- if (nargin < 3)
- lineWidth = 2;
- end;
- if (exist(fileName, 'file') == 0)
- error('myApp:filenotfound', 'Soubor neexistuje.');
- end;
- S11 = xlsread(fileName);
- if (length(S11) > 5000)
- warning('myApp:longfile', 'Soubor je delÜφ ne₧ 5000 °ßdk∙.');
- end;
- S11 = [S11(:,1), S11(:,2) .* exp(1i * S11(:,3) / 180 * pi)];
- Z0 = 50;
- Zin = Z0 .* ((1 + S11(:,2)) ./ (1 - S11(:,2)));
- f = S11(:,1);
- figure('Name', 'Vstupnφ impedance');
- plot(f, real(Zin), 'Color', 'blue', 'LineWidth', lineWidth, 'DisplayName', 'Real part');
- hold on;
- plot(f, imag(Zin), 'Color', 'green', 'LineWidth', lineWidth, 'DisplayName', 'Imaginary part');
- title('Vstupnφ impedance');
- xlabel('f [GHz]');
- ylabel('Zin [\Omega]');
- legend show;
- if(isGrid)
- grid on;
- end;
- figure('Name', 'Koeficient odrazu');
- plot(f, abs(S11(:,2)), 'Color', 'blue', 'LineWidth', lineWidth);
- title('Koeficient odrazu');
- xlabel('f [GHz]');
- ylabel('|S11|');
- if(isGrid)
- grid on;
- end;
- profile off;
- profile report;
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement