Azzera filtri
Azzera filtri

How to number permutation values in "for" loop to be sequentially printed as 1, 2, 3 etc?

4 visualizzazioni (ultimi 30 giorni)
Hi. I have
a = [1 2 3]
b = [1 2 3]
c = [1 2 3]
I am running for loop for i = 1:3, j= 1:3 and m = 1:3. I need to print the output in terms of 1, 2, 3, 4, etc, instead of 111, 112, 113, 114, etc.

Risposta accettata

Stephen23
Stephen23 il 20 Giu 2018
Modificato: Stephen23 il 20 Giu 2018
cnt = 0;
for ii = 1:3
for jj = 1:3
for kk = 1:3
cnt = cnt+1
...
end
end
end
  3 Commenti

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Loops and Conditional Statements in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by