Error in executing freqz command on LINUX server

5 ビュー (過去 30 日間)
Neuling
Neuling 2025 年 1 月 22 日
コメント済み: Neuling 2025 年 1 月 23 日
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.

採用された回答

David Goodmanson
David Goodmanson 2025 年 1 月 23 日
編集済み: David Goodmanson 2025 年 1 月 23 日
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
  1 件のコメント
Neuling
Neuling 2025 年 1 月 23 日
Thank you, it seems like that's the workaround

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeBartlett についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by