accessing and writing for loop for struct array
16 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
ı have created a struct array with 3 level student.name student.score student.letter
ı have the information of the name and the scores of the students but ı have to write a for loop to assıgn letter grades (a-f) to as a third field. Howver, ı cannot reach into the struct of the array, what can I do?
0 Commenti
Risposta accettata
KSSV
il 5 Nov 2016
Let there be 5 students with the below grades.
grades = {'a' 'c' 'e' 'f' 'b'} ;
for i = 1:length(student)
student(i) = grades{i} ;
end
0 Commenti
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!