How to convert a col array into a struct array field?
이전 댓글 표시
I have an struct array with multiplie fields and i want to assign a new field wich values come from a col array of a function.
Example:
Supose that my function returns "a"
a = [1; 2; 3; 4; 5; 6; 7; 8; 9; 10]
empty_test.a = [];
empty_test.b = [];
test = repmat(empty_test, size(a,1),1);
test.a = a; % Wrong
I want something like this as a result:
test(1).a = 1;
test(2).a = 2;
...
test(10).a = 10;
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Structures에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!