Editing Library Blocks

조회 수: 11 (최근 30일)
Balazs
Balazs 2011년 5월 31일
Is it possible to modify the behavior of Simulink Library blocks? The present situation is that I need to use the I2C Rx (and Tx) Library blocks for Texas 28335 processors, and the read data length is varying. The data length can only be set via the dialog box, but I'd like to feed it through an Input port. What should I do?
I've searched for the available sources in the Matlab paths:
  • the block itself
  • the "Edit mask" preferences
  • some callback functions in an .m file
  • a translated file with some behavior of the block (.tlc)
Should I modify the .tlc and .m file, or is it useless? I've tried it with no success...

답변 (1개)

Fangjun Jiang
Fangjun Jiang 2011년 5월 31일
You can always make your own library blocks based on the Simulink library blocks. That is the answer to your question title. However, this approach won't work for your problem. You can mask the parameter. But there is a big difference between the parameter through the parameter dialog and a varying signal through a port. The value of the parameter can't change while the simulation is running. I think you are out of luck if you want to do it through "editing library blocks". You may need to develop your own block using s-function or embedded matlab function.

카테고리

Help CenterFile Exchange에서 Target Language Compiler에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by