필터 지우기
필터 지우기

Simulink variables initializtion problem

조회 수: 2 (최근 30일)
Hyunsoo Park
Hyunsoo Park 2017년 2월 3일
답변: Hyunsoo Park 2017년 2월 6일
https://www.mathworks.com/examples/simpower/mw/sps_product-power_PVarray_250kW-250-kw-grid-connected-pv-array
According to this example, all initial variables are defines in power_PVarray_250kW_param.m. It seems that this m files is called at starting simulation. But when I make new simulink file, and even copyed all contents in power_PVarray_250kW.slx, but it doesn't worked.
There are error messages, "Error evaluating parameter 'NominalPower' in 'aaa/120 kV // 25 kV 47 MVA'"
My question is
1. How can I define initial values in simulink using m file 2. Is any options or method to eliminate error messages?
Thanks.

채택된 답변

Hyunsoo Park
Hyunsoo Park 2017년 2월 6일
I found answer;
Menu File -> Model Properties -> Callbacks. In the "PreLoadFcn", you can use a load command. Variables are still stored in MATLAB workspace.

추가 답변 (1개)

Ben Rancici
Ben Rancici 2017년 2월 3일
Are you sure that 'NominalPower' is well defined in 'power_PVarray_250kW_param.m'? If so, have you launched this .m file before running the Simulink?
  댓글 수: 1
Hyunsoo Park
Hyunsoo Park 2017년 2월 3일
편집: Hyunsoo Park 2017년 2월 3일
In case of demonstration file, there is no need to launch m file. I want to automatically launch m file, when simulation starts

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

카테고리

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