MATLAB: How i can found the region of absolute stability

plotsymmtric

n=0:30:180
h=((768 *cos((1/2)*n) + 96* cos(n) - 864) ./ (40*cos (1/2*n)+ 2*cos(n)+ 102))
figure
plot(n,h, 'b*-', 'LineWidth', 2)
grid on;
xlabel('n', 'FontSize', 20);
ylabel('h', 'FontSize', 20);

Best Answer

Because you're using / (array division) instead of ./ (element by element division). Try this:
n=0:30:180
h=((768 *cos((1/2)*n) + 96* cos(n) - 864) ./ (40*cos (1/2*n)+ 2*cos(n)+ 102))
figure
plot(n,h, 'b*-', 'LineWidth', 2)
grid on;
xlabel('n', 'FontSize', 20);
ylabel('h', 'FontSize', 20);
% Do it again with more resolution.
n = linspace(min(n), max(n), 1000);
h=((768 *cos((1/2)*n) + 96* cos(n) - 864) ./ (40*cos (1/2*n)+ 2*cos(n)+ 102))
hold on;
plot(n,h, 'r-', 'LineWidth', 2)
grid on;
xlabel('n', 'FontSize', 20);
ylabel('h', 'FontSize', 20);
Related Question