I want to convert this pesudo code to MATLAB code.

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 Commenti

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}
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.

Accedi per commentare.

Risposte (1)

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

Categorie

Richiesto:

il 9 Feb 2023

Community Treasure Hunt

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

Start Hunting!

Translated by