how to make the output change in a loop
3 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Faisal Al-Wazir
il 27 Gen 2022
Commentato: Faisal Al-Wazir
il 28 Gen 2022
%greetings
%im doing a code to add an unlimted team names
%my isseue is i don't know how to make the output change every time the loop is runinng
disp("how many teams ")
v=input('Num: ')
n=1
for a=1:v
t = strcat( 'variable_',num2str(v) )
variable.(t) = v
if n>0
n=1
n=input('team Name: ','s')
else
disp("alright")
end
end
1 Commento
Voss
il 27 Gen 2022
You're probably going to want to use the variable 'a' somewhere in your for loop, since that is the loop iteration variable.
Risposta accettata
Più risposte (0)
Vedere anche
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!