フィルターのクリア

Why this code the given error?

4 ビュー (過去 30 日間)
Sadiq Akbar
Sadiq Akbar 2021 年 9 月 8 日
コメント済み: Sadiq Akbar 2021 年 9 月 13 日
close all; clear all; clc;
vec = @(MAT) MAT(:);
vecH = @(MAT) MAT(:).';
% M = 5;
M = 10;
N = 4;
% N = 10;
d = 0.5;
K = 3;
SNR_dB = 20;
steerVecT = @(ang) exp(1j*2*pi*d*[0:M-1].'*sin(vecH(ang)));
steerVecR = @(ang) exp(1j*2*pi*d*[0:N-1].'*sin(vecH(ang)));
angleGrid = [-80:1e-2:80].';
steerGrid = steerMatTR(deg2rad(angleGrid), steerVecT, steerVecR);
rng(222);
targetAngle = [-30, 0, 40].'+rand(K, 1);
A = ones(K, 1);
steerM = steerMatTR(deg2rad(targetAngle), steerVecT, steerVecR);
r = steerM*A;
noiseVar = r' * r / length(r) / db2pow(SNR_dB);
w = sqrt(noiseVar / 2) * (randn(size(r)) + 1j * randn(size(r)));
y = r+w;
lambda = 2*sqrt(M*N*log(M*N))*sqrt(noiseVar);
cvx_begin sdp quiet
variable x(N*M,1) complex
variable F(M*N,M*N) hermitian
minimize(norm(y-x))
subject to
[F, x; x', lambda^2]>=0
for idxN1 = 0 : 1 : N-1
for idxN2 = 0 : 1 : N-1
Ftmp = F(idxN1*M+1:idxN1*M+M, idxN2*M+1:idxN2*M+M);
for delta = -(M-1) : 1 : M-1
if ((idxN1==idxN2) && (delta==0))
sum(diag(Ftmp, delta)) <= 1/N;
else
sum(diag(Ftmp, delta)) == 0;
end
end
end
end
cvx_end
spectrumANM = abs(x'*steerGrid).^2;
spectrumANM = spectrumANM/max(spectrumANM);
figure; plot(angleGrid, spectrumANM);
% User defined function
function steerM = steerMatTR(targetAngle, steerVecT, steerVecR)
steerA = steerVecT(targetAngle);
steerB = steerVecR(targetAngle);
steerM = zeros(size(steerA, 1)*size(steerB, 1), length(targetAngle));
for idxK = 1 : 1 : length(targetAngle)
steerM(:, idxK) = kron(steerB(:, idxK), steerA(:, idxK));
end
After running the above code, it gives the following error:
Undefined function 'cvx_begin' for input arguments of type 'char'.
Error in main (line 32)
cvx_begin sdp quiet
Can anyone help me in this regard?
  3 件のコメント
Sadiq Akbar
Sadiq Akbar 2021 年 9 月 8 日
Thanks for the responses of both of you dear DGM and Adam Danz. No, I don't know anything about CVX? what is that and how to install that?

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

採用された回答

the cyclist
the cyclist 2021 年 9 月 8 日
CVX is a third-party MATLAB toolbox (i.e. not from MathWorks), that you need to install according to their instructions. You need to go to their website to do that.
  11 件のコメント
the cyclist
the cyclist 2021 年 9 月 12 日
@Sadiq Akbar, you won't be able to officially accept @Walter Roberson's. The reason is that I answered your original question (so you could accept that), but then you asked additional questions in the ensuing comments. Walter was kind enough to answer those additional questions in his comments, but unfortunately comments cannot be accepted or upvoted.
Sadiq Akbar
Sadiq Akbar 2021 年 9 月 13 日
Thank you very much dear the cyclist for your guidance. Ok I am going to accept that. But actually I am thankful to all of you as I have mentioned earlier.

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

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by