How to set Parameters of Block "custcode/System Outputs"

How can I set the Code for the block "custcode/System Outputs" programmatically? I receive an error "Size arguments must be real integers" when opening the block by double-click after running the following:
add_block('custcode/System Outputs','model/subsystem')
field = setfield(get_param('model/subsystem/systemOutput','RTWData'),'Top','test');
set_param('Copy_of_model_vergleich_atom/Subsystem1/test','RTWData',field);

댓글 수: 2

Would it be possible to share a sample model and code? Implementing the above commands on a basic 'Outport' block in Simulink (R2015b) does not throw the error.
But that's what throws the error for me. I'm not using a "basic" output port, but "System Output" block from custcode-library.

댓글을 달려면 로그인하십시오.

 채택된 답변

Steffen Müller
Steffen Müller 2016년 2월 24일
편집: Steffen Müller 2016년 2월 24일
I found myself a solution: Adding a newline after the desired function call of the field (for whatever reason):
add_block('custcode/System Outputs','model/subsystem')
field = setfield(get_param('model/subsystem/systemOutput','RTWData'),'Top', ['test' char(10)]);
set_param('Copy_of_model_vergleich_atom/Subsystem1/test','RTWData',field);

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Simulink에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by