Change intensity of zplane figure
Show older comments
Hello everyone,
I was trying to change the line-width of the zplane figure in order to make it more visible.I tried the set command but it didnt work.How can i fix it so it can work?
Thanks in advance.
This is my code so far:
function Lab2_Part_One
close all;
clearvars;
% Create directory if it doesn't exist
directory = 'Ask1';
if ~isfolder(directory) %For versions before R2017b use exist
% instead of is folder
mkdir(directory);
end
% Given transfer function
num = [0.2 0]; % Numerator coefficients
den = [1 -0.7 -0.18]; % Denominator coefficients
w = -pi:pi/128:pi; % Frequency range
% Function calls
plotPoleZeroPlot(num, den, directory);
end
function plotPoleZeroPlot(num, den, directory)
% Function to plot the pole-zero plot
figure;
h = zplane(num, den);
% Set the properties for poles (red lines)
set(h_poles, 'Color', 'green', 'LineWidth', 2); % Change color to green and line width
% Set the properties for zeros (blue lines)
set(h_zeros, 'Color', 'magenta', 'LineWidth', 1.5); % Change color to magenta and line width
% Redraw the unit circle with the desired linewidth
hold on;
t = 0:0.01:2 * pi; % Define points for the unit circle
plot(cos(t), sin(t), 'Color', [0 0.4470 0.7410], 'LineWidth', 1); % Plot the unit circle with the desired linewidth
%grid on;
title('Pole-Zero Plot of the Transfer Function H(z)');
% Save the pole-zero plot in the specified directory as a PNG file
filename = fullfile(directory, 'pole_zero_plot.png');
saveas(gcf, filename);
end
Accepted Answer
More Answers (0)
Categories
Find more on Digital Filter Analysis in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!




