Building Simulink Modell from Matlab Code

조회 수: 1 (최근 30일)
Lennart
Lennart 2015년 7월 8일
댓글: Azzi Abdelmalek 2015년 7월 8일
Hi there,
I am currently trying to build Simulink models from Matlab code and have some problems with.
My main problem is to figure out the names and/or path' of the blocks and their parameters. To find the block names I could find a workaround but I have no clue how to figure out the proper names of the parameters of one block. I would very appreciate if someone could tell me a function that returns the parameters or some workaround, so that I can change the parameters with
set_param('path to block','parameter name','parameter value')
Thank you very much!
Regards,
Lennart
  댓글 수: 3
Azzi Abdelmalek
Azzi Abdelmalek 2015년 7월 8일
This is not clear
Azzi Abdelmalek
Azzi Abdelmalek 2015년 7월 8일
Can you explain with an example?

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

채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2015년 7월 8일
get_param('path to block','DialogParameters')
  댓글 수: 6
Lennart
Lennart 2015년 7월 8일
편집: Lennart 2015년 7월 8일
I don't know how else I should explain it. Just take the example. The path that you click with the mouse has nothing in common with the path that needs to be entered in the add_block-function. Of course every block is located somewhere in the Simulink library but how am I supposed to figure out where if the path that I take in the Simulink library browser is not what I have to enter in the add_block-function.
This for example is how I use the add_block-function to add an input port:
add_block('built-in/Inport',[opt.sys '/Signal' num2str(i)],'Position', pos);
Guess I will stick to my workaround then. Thank you for time and help!!!
Azzi Abdelmalek
Azzi Abdelmalek 2015년 7월 8일
If you have a liste of blocks that a user can choose. You can associate to each block a path. Just create another liste of path

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Programmatic Model Editing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by