I want to convert this pesudo code to MATLAB code.

1 Ansicht (letzte 30 Tage)
Saqib Saeed
Saqib Saeed am 9 Feb. 2023
Kommentiert: Walter Roberson am 9 Feb. 2023
Algorithm 1 Joint Optimization Algorithm
1: Set i = 0
2: Initialize Ract,i to be the edge-most radar subcarriers
3: Set Ract,new,i = ∅
4: while i ≤ Nact do
5: Compute CRLB(ˆ)i and CRLB(fˆD)i
6: Select the activated radar subcarrier having the minimum
¯ fn, with indices {nmin,mmin}
7: Select the unactivated radar subcarrier having the maximum
¯ fn on the maximum ¯tm time instant, with
indices {nmax,mmax}
8: Set Xr,nmax,mmax = Xr,nmin,mmin
9: Set Xr,nmin,mmin = 0
10: Ract,i+1 = Ract,i\{nmin,mmin}
11: Ract,new,i+1 = Ract,new,i ∪ {nmax,mmax}
12: i ←− i + 1
  2 Kommentare
Saqib Saeed
Saqib Saeed am 9 Feb. 2023
what about line 5-11 MATLAB code
5: Compute CRLB(ˆ)i and CRLB(fˆD)i
6: Select the activated radar subcarrier having the minimum
¯ fn, with indices {nmin,mmin}
7: Select the unactivated radar subcarrier having the maximum
¯ fn on the maximum ¯tm time instant, with
indices {nmax,mmax}
8: Set Xr,nmax,mmax = Xr,nmin,mmin
9: Set Xr,nmin,mmin = 0
10: Ract,i+1 = Ract,i\{nmin,mmin}
11: Ract,new,i+1 = Ract,new,i ∪ {nmax,mmax}
Walter Roberson
Walter Roberson am 9 Feb. 2023
If you obtained the algorithm from a book or paper, please show us an image of the algorithm as published. Some of the notation you are using is... unfamiliar.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Rishav
Rishav am 9 Feb. 2023
I have provided you a code, you need to initialise Ract_i to some initial value (edge-most radar subcarriers), and Nact should also be provided for while condition execution.
% Set i to 0
i = 0;
% Initialize Ract,i to be the edge-most radar subcarriers
Ract_i = some_initial_value;
% Set Ract,new,i to be an empty set
Ract_new_i = [];
% While loop
while i <= Nact
% Increment i by 1
i = i + 1; % You can change this execution according to you
end

Kategorien

Mehr zu Environment and Clutter finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by