How to change a variable inside a Value structure in a Simulink.Parameter?
조회 수: 6 (최근 30일)
이전 댓글 표시
MathWorks Support Team
2019년 5월 29일
답변: MathWorks Support Team
2019년 6월 17일
I have a Simulink.Parameter object P where P.Value is a struct, so how can I change a variable inside the Value structure?
채택된 답변
MathWorks Support Team
2019년 6월 18일
You can do this by using the normal MATLAB assignment syntax as in the following example:
Construct a Simulink.Paramter object P with some dummy data in P.Value and display it in the Command Window:
>> P = Simulink.Parameter;
>> P.Value = struct('field1',1,'field2',2)
>> P.Value
Next change the value in P.Value.field1 from 2 to 3 using the usual assignment syntax and display it in the Command Window:
>> P.Value.field1 = 3;
>> P.Value
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Hypothesis Tests에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!