Question about Matlab coder
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Johan Johan
am 7 Jul. 2018
Kommentiert: Johan Johan
am 7 Jul. 2018
The point between popc(k,1) and cost -- what does it mean?
popc(k,1).Cost=CostFunction(popc(k,1).Position);
0 Kommentare
Akzeptierte Antwort
Image Analyst
am 7 Jul. 2018
I don't know what this has to do with the Coder Toolbox, but anyway the dot indicates a separator between the name of the structure array "popc", and a field of that structure array called "Cost".
popc is a 2-D array (a matrix) of structures. Each structure has two or more fields (members). One of those fields is called "Cost" and another is called "Position". You can find out all of them with this command
allFieldNames = fieldnames(Cost);
That code gives a value to the Cost field of the structure located at row k, column 1 of the matrix of structures.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Structures finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!