Accessing parameters in encrypted models

조회 수: 12 (최근 30일)
Magnus Sandell
Magnus Sandell 2024년 8월 2일
댓글: Magnus Sandell 2024년 8월 8일
I have an encrypted Simulink model with some tunable parameters. I can change them by right-clicking on the model and choosing 'Block Parameters (ModelReference)'. However, unlike other (nonencrypted) blocks, I can't change them by using 'set_param'. Is there any way of accessing these parameters from the command line? I'm using Simulink R2015b.

채택된 답변

arushi
arushi 2024년 8월 7일
Hi Magnus,
When dealing with an encrypted Simulink model, you are limited in how you can interact with the model's parameters from the command line. In general, encrypted models restrict certain functionalities to protect intellectual property, which includes direct access to parameters via set_param. However, you can still change tunable parameters if the model author has provided a mechanism for doing so.
Here are a few approaches you can try:
Approach 1: Use Model Workspace Variables
If the parameters are defined in the model workspace, you can modify them using the get_param and set_param functions to access the model workspace and change the variables.
Approach 2: Use setVariable Method
If the parameters are stored in a model workspace, you can use the setVariable method to change their values.
Hope this helps.
  댓글 수: 1
Magnus Sandell
Magnus Sandell 2024년 8월 8일
@arushi, Thanks for the answer. Unfortunately neither approach worked, so I guess the authors have not provided access to these variables from the command line.

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

추가 답변 (0개)

카테고리

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

제품


릴리스

R2015b

Community Treasure Hunt

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

Start Hunting!

Translated by