Why this code gives error?

3 ビュー (過去 30 日間)
Sadiq Akbar
Sadiq Akbar 2021 年 9 月 16 日
編集済み: Walter Roberson 2021 年 9 月 21 日
Nc=31; N=5; M=3; K=3; tot_len=200;
array_TX =[3.5086 0 0;2.6877 2.2553 0;0.6093 3.4553 0;-1.7543 3.0385 0;-3.2970 1.2000 0;
-3.2970 -1.2000 0;-1.7543 -3.0385 0;0.6093 -3.4553 0;2.6877 -2.2553 0];
array_RX =[0.8507 0 0;0.2629 0.8090 0;-0.6882 0.5000 0;
-0.6882 -0.5000 0;0.2629 -0.8090 0];
DOA =[270 180 70 89 158 204 208 339 167].';
DOD =[40 120 150 195 223 161 75 350];
91
recvd_data = myreceived_data(Nc,N,M,K,tot_len,array_TX,DOD,array_RX,DOA);
  2 件のコメント
Walter Roberson
Walter Roberson 2021 年 9 月 16 日
myreceived_data is not a Mathworks function, but the problem is occurring inside it. We would need the code.
Sadiq Akbar
Sadiq Akbar 2021 年 9 月 16 日
Thank you very much dear Walter Roberson for your response. The requirede function is as below:
%1-Received data
function recvd_data = myreceived_data(Nc,N_bar,N,M,K,tot_len,array_TX,DOD,array_RX,DOA)
recvd_data1 = zeros(N,tot_len*Nc);
shift_data = zeros(N_bar,tot_len*Nc,M,K);
for m = 1:M
for k = 1:K
shift_data(:,:,m,k) = circshift(data_tx_ss(:,:,m),[0,delays(m,k)]); % Shift circularly columns of matrix towards right
end
end
for m = 1:M
for k = 1:K
for t = 1:tot_len
S_TX = spv(array_TX, [DOD(k+(m-1)*K) 0]);
S_RX = spv(array_RX, [DOA(k+(m-1)*K) 0]);
recvd_data(:,Nc*(t-1)+1:Nc*t) = recvd_data1(:,Nc*(t-1)+1:Nc*t) + (beta(k+(m-1)*K,t)*S_RX).*(S_TX'*shift_data(:,Nc*(t-1)+1:Nc*t,m,k));% it is x(t) in eq.(6)
end
end
end
end % function end

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

採用された回答

Fernando Peña
Fernando Peña 2021 年 9 月 16 日
When calling the function, you are missing the variable N_bar.
  5 件のコメント
Walter Roberson
Walter Roberson 2021 年 9 月 16 日
編集済み: Walter Roberson 2021 年 9 月 21 日
Because Array_TX is not defined by that code.
Sadiq Akbar
Sadiq Akbar 2021 年 9 月 21 日
Yes you are rigth dear Walter Roberson. Thank you so much.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDirection of Arrival Estimation についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by