Error in executing freqz command on LINUX server

1 view (last 30 days)
I am trying to execute the command
[H,w] = freqz(b,a);
on the server machine of my university and it throws the following error: Bundle#165 start failed: libXcomposite.so.1: cannot open shared object file: No such file or directory.
I understand the error is due to the graphics. Could someone help me to solve this error? I do not need graphics, but just the FRF H and frequency vector w. I used the command matlab -nodisplay, but it doesn't help.

Accepted Answer

David Goodmanson
David Goodmanson on 23 Jan 2025
Edited: David Goodmanson on 23 Jan 2025
Hi Neuling,
If all else fails you could just write your own version. Something like
function [H w] = freqz1(b,a,n);
% parallels freqz for vectors of coefficients b,a, number of freqs n.
w = linspace(0,pi,n+1)';
w(end) = [];
Hn = zeros(n,1);
for k = 1:length(b)
Hn = Hn + b(k)*exp(j*w*(1-k));
end
Hd = zeros(n,1);
for k = 1:length(a)
Hd = Hd + a(k)*exp(j*w*(1-k));
end
H = Hn./Hd;
end
There are fancier ways, but the code just used a for loop.
As a test:
b = [1 2 3];
a = [3 4 5 6];
[H w] = freqz(b,a);
[H1 w1] = freqz1(b,a,512);
max(abs(w-w1)) ans = 4.4409e-16
max(abs(H-H1)) ans = 2.7972e-15

More Answers (0)

Categories

Find more on Graphics Object Programming 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!