Question about Matlab coder

조회 수: 8 (최근 30일)
Johan Johan
Johan Johan 2018년 7월 7일
댓글: Johan Johan 2018년 7월 7일
The point between popc(k,1) and cost -- what does it mean?
popc(k,1).Cost=CostFunction(popc(k,1).Position);

채택된 답변

Image Analyst
Image Analyst 2018년 7월 7일
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.
  댓글 수: 1
Johan Johan
Johan Johan 2018년 7월 7일
Thanks for your answer

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Structures에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by