How to Expand an Existing Structure Array?

조회 수: 4 (최근 30일)
Rightia Rollmann
Rightia Rollmann 2017년 3월 4일
답변: Walter Roberson 2017년 3월 4일
As a simple example, I create the struct B with one field:
B.D = 1;
How do I set parent struct A for the above-mentioned struct B?
A.B.D
How do I set a field between B and D?
B.C.D

채택된 답변

Walter Roberson
Walter Roberson 2017년 3월 4일
"How do I set parent struct A for the above-mentioned struct B?"
A.B = B;
"How do I set a field between B and D?"
temp = B.D;
B = rmfield(B, 'D');
B.C.D = temp;

추가 답변 (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