Info
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
How to Access These Values of This Struc without Using a For Loop?
조회 수: 1 (최근 30일)
이전 댓글 표시
Here’s my initial struct:
A(1).B.C = 'a';
A(2).B.C = 'b';
A(3).B.C = 'a';
A(4).B.C = 'a';
I want to change the values of C based on values of Values and indexes of IndexingArray:
Values = {'a', 'b'}
IndexingArray = [1 1 0 1];
So, my struct will be:
A(1).B.C = 'b';
A(2).B.C = 'b';
A(3).B.C = 'a';
A(4).B.C = 'b';
Isn’t really there a way to do it without using a for loop?
댓글 수: 1
Jan
2017년 3월 13일
Please do not post a question multiple times. See https://www.mathworks.com/matlabcentral/answers/329467-how-to-change-values-of-a-field-by-an-indexing-array . Thanks.
답변 (0개)
이 질문은 마감되었습니다.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!