Error when using (self created) library block in a model

조회 수: 2 (최근 30일)
Yohann GOYER
Yohann GOYER 2024년 5월 30일
답변: Yohann GOYER 2024년 6월 14일
I have created a block in a library.
This block works (correct / expected behavior) when I try it in library directly.
But when I import the block in a model, I got error: parameter callback errors.
The block behavior is to modify its content (remove or add block inside) according to parameter values.
It can works in model if i cut the link to the library, but after I got lot of warning from advisor ...

채택된 답변

Yohann GOYER
Yohann GOYER 2024년 6월 14일
I got answer from matlab support and I share it here.
In fact the code was in the parameter callback.
But the code shall be place under intitialize callback instead.
After doning that, block works without problem.

추가 답변 (1개)

Fangjun Jiang
Fangjun Jiang 2024년 5월 30일
편집: Fangjun Jiang 2024년 5월 30일
Follow this.
If possible, don't do delete_block() and add_block(). Using replace_block() might work.

카테고리

Help CenterFile Exchange에서 Model, Block, and Port Callbacks에 대해 자세히 알아보기

제품


릴리스

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by