Azzera filtri
Azzera filtri

how to display how many looping are working on

1 visualizzazione (ultimi 30 giorni)
Raja Zufar
Raja Zufar il 2 Ago 2020
Risposto: SAA il 6 Ago 2020
Hallo i have this part of code,
I want to see how many TTI looping are working on in the "command window" bar. because I don't know how long this program will run and how many repetitions have happened
TTI=1000;
for x=1:TTI
[r_TxPU_TTI(:,x), r_TxPU_RxPU_TTI(:,x), r_TxSU_TTI(:,x),r_TxSU_RxSU_TTI(:,x), r_TxSU_RxPU_TTI(:,((jumlah_SU*x) -var):(x*jumlah_SU)),r_TxPU_RxSU_TTI(:,((jumlah_SU*x)-var):(x*jumlah_SU))] = generate(radius_cell, radius_Tx, teta_cell, jumlah_PU, jumlah_SU);
end
Thank you :))
  1 Commento
Spectro
Spectro il 3 Ago 2020
Simply add disp(x) to the body of the cycle like below:
TTI=1000;
for x=1:TTI
[r_TxPU_TTI(:,x), r_TxPU_RxPU_TTI(:,x), r_TxSU_TTI(:,x),r_TxSU_RxSU_TTI(:,x), r_TxSU_RxPU_TTI(:,((jumlah_SU*x) -var):(x*jumlah_SU)),r_TxPU_RxSU_TTI(:,((jumlah_SU*x)-var):(x*jumlah_SU))] = generate(radius_cell, radius_Tx, teta_cell, jumlah_PU, jumlah_SU);
disp(x)
end
or look up fprintf(), but i think disp() should do if your goal is just to know in what iteration you are..

Accedi per commentare.

Risposte (1)

SAA
SAA il 6 Ago 2020
you can just type x in yout loop and see what it is
TTI=1000;
for x=1:TTI
[r_TxPU_TTI(:,x), r_TxPU_RxPU_TTI(:,x), r_TxSU_TTI(:,x),r_TxSU_RxSU_TTI(:,x), r_TxSU_RxPU_TTI(:,((jumlah_SU*x) -var):(x*jumlah_SU)),r_TxPU_RxSU_TTI(:,((jumlah_SU*x)-var):(x*jumlah_SU))] = generate(radius_cell, radius_Tx, teta_cell, jumlah_PU, jumlah_SU);
x
end
or as Spectro suggeste use disp or frprintf, this one is better
TTI=1000;
for x=1:TTI
[r_TxPU_TTI(:,x), r_TxPU_RxPU_TTI(:,x), r_TxSU_TTI(:,x),r_TxSU_RxSU_TTI(:,x), r_TxSU_RxPU_TTI(:,((jumlah_SU*x) -var):(x*jumlah_SU)),r_TxPU_RxSU_TTI(:,((jumlah_SU*x)-var):(x*jumlah_SU))] = generate(radius_cell, radius_Tx, teta_cell, jumlah_PU, jumlah_SU);
fprintf('Iteration #%d\n', x);
end

Categorie

Scopri di più su Characters and Strings in Help Center e File Exchange

Prodotti


Release

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by