How to access table/compile-time data in Simulink models?

조회 수: 6 (최근 30일)
Mark
Mark 2023년 12월 6일
댓글: Mark 2023년 12월 19일
The screen capture below is from the Motor included in the Fuel Cell / EV reference application. How do I access / view / modify the parameters shown here, such as "Mot.maxT"?
Thanks,
Mark

답변 (1개)

Aditya
Aditya 2023년 12월 15일
Hi Mark,
I understand that you are looking to access and modify the parameters of the 'Motor & Drive (System Level)' block in your Simulink model, such as "Mot.maxT".
Here's how you can proceed:
  1. Check the Base Workspace: Open the MATLAB Command Window and use the command whos to list all variables in the base workspace. If "Mot" is a structure containing your parameters, it should appear in this list.
  2. Access Struct Variables: If "Mot" is indeed a structure, you can access its contents by typing Mot in the Command Window. To specifically see the "maxT" parameter, you can type Mot.maxT.
  3. Modify Parameters: If you find the parameter, you can modify it directly from the Command Window by typing Mot.maxT = newValue;, where newValue is the value you want to assign to the parameter.
  4. Save Changes: After modifying the parameter, you need to save the changes to the workspace. Use the command save if you want to save the workspace variables to a MAT file.
  5. Update Simulink Model: Go back to your Simulink model and update it to reflect the changes. This can be done by clicking the "Update Model" button in the Simulink toolbar.
If you do not find the "Mot" structure in the base workspace, it might be defined elsewhere, here’s how you can check it:
  • Search for Referenced Variables: Within the Simulink model environment, right-click on an empty area of the model background and select 'Find Referenced Variables'. This action will display a table listing all the variables along with their respective paths, which can guide you to the location of the "Mot" structure.
Hope this helps!
  댓글 수: 1
Mark
Mark 2023년 12월 19일
Thanks. It took me a while to find it, but the "Variable Editor" gets me to where I need to be, I think. Thanks!

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

카테고리

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

제품


릴리스

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by