Error in executing freqz command on LINUX server
조회 수: 1 (최근 30일)
이전 댓글 표시
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.
댓글 수: 0
채택된 답변
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
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Bartlett에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!