loop to assign an array to a string and the create a structure array
조회 수: 4 (최근 30일)
이전 댓글 표시
field_1 = 'Response_1'
field_2 = 'Response_2'
field_3 = 'Response_3'
field_4 = 'Response_4'
field_5 = 'Response_5'
field_6 = 'Response_6'
field_7 = 'Response_7'
field_8 = 'Response_8'
field_9 = 'Response_9'
field_10 = 'Response_10'
field_11 = 'Response_11'
field_12 = 'Response_12'
field_13 = 'Response_13'
field_14 = 'Response_14'
field_15 = 'Response_15'
field_16 = 'Response_16'
field_17 = 'Response_17'
field_18 = 'Response_18'
field_19 = 'Response_19'
field_20 = 'Response_20'
s = struct(field_1,FR_1(:,2),....
filed_20,FR_20(:,2))
How can I create a loop to assign an array (Response_1 to Response_20) to a string (field_1 to field_20) and then create another loop to create a structure array (s) that contains Response_1 to Response_20?
댓글 수: 1
Stephen23
2019년 7월 30일
Why not just use indexing?
Indexing would be much simpler and much more efficient that what you are trying to do.
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Structures에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!