필터 지우기
필터 지우기

Parameter estimator not able to list some variables as parameter

조회 수: 4 (최근 30일)
Pranesh Dewangan
Pranesh Dewangan 2022년 12월 21일
답변: Akshat Dalal 2023년 9월 11일
I have a simulink model which i am initialising using a matlab script (A). i have another script inside A which constructs a state space. Basically it has a variable which represents the state matrix and an input matrix which has some variables as elements. The parameter estimator tool is not able to list the variables inside those matrices since they are not model parameters. i tried to follow Matlab help which is this.
Before, i put these lines in the callback, i tried to run them in the command window and even before i declared them as mentioned in the help section separately like this.
i get this error.
>> Cp_cell_pack = evalin(wks,'Cp_cell_pack')
Unrecognized function or variable 'Cp_cell_pack'.
I also realise that these parameters which i am trying to estimate are invisible to the tool since they are not listed as model parameters. Evident here:
What am i missing? Please help.

답변 (1개)

Akshat Dalal
Akshat Dalal 2023년 9월 11일
Hi Pranesh,
I understand you are facing an error while trying to estimate variables that are not model parameters.
You are facing this error because when you initialize your model using your MATLAB script ‘A’, the variables get stored in the ‘Base Workspace’ by default. However, in the MATLAB help code you are referring to, the variable ‘wks’ points to the ‘Model Workspace’, and thus expects your variables to be in the ‘Model Workspace’.
To load variables directly into ‘Model Workspace’ instead of ‘Base Workspace, open Model Explorer from the view menu and then choose ‘Model Workspace. You will see option to specify different ways for getting data on the rightmost pane. Select MATLAB File and choose your MATLAB script ‘A’ as the source.

카테고리

Help CenterFile Exchange에서 Event Functions에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by