accessing and writing for loop for struct array

11 ビュー (過去 30 日間)
Özge Bozkurt
Özge Bozkurt 2016 年 11 月 5 日
回答済み: KSSV 2016 年 11 月 5 日
ı 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?

採用された回答

KSSV
KSSV 2016 年 11 月 5 日
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 件)

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by