필터 지우기
필터 지우기

get_param and set_param not running

조회 수: 7 (최근 30일)
Sameer Agarkar
Sameer Agarkar 2023년 7월 5일
편집: John D'Errico 2023년 7월 5일
When I am trying to use get_param and set_param, sometimes it works, sometimes it doesn't, can someone tell why these irregularities are there??
  댓글 수: 1
John D'Errico
John D'Errico 2023년 7월 5일
편집: John D'Errico 2023년 7월 5일
Probable user error. Sometimes you use it properly, sometimes you don't. Yes, I did try using the mind reading toolbox, but well, sometimes it works, sometimes it does not.
If you want a better answer than that, then you need to show an example of where it does not work as you want it to work.

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

답변 (1개)

Sanskar
Sanskar 2023년 7월 5일
Hi Sameer!
This might be happening because sometime while running the code your model must be loaded and other times not. For get_param() and set_param() to run model must be loaded. So what you can do is load your system in the code, so that every time you run get_param and set_param, code will run smoothly.
Use following syntax
load_system(modelName)
Refer to this documentation:
Hope this helps!

카테고리

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