declaring multi global variables with simulink model1

조회 수: 1 (최근 30일)
Mohamed
Mohamed 2020년 1월 18일
댓글: Mohamed 2020년 1월 21일
Hello every one
please I need some boday to help me to solve an error that bub-up to me and I could not solve it.
I am bulding a model predictive controller using the differencail equation models for plant and my main function which is the controller statements in a matlab function block, I also used the an other file to declare the variables .
(this examlpe from the PREDICTIVE CONTROL OF POWER CONVERTERS AND ELECTRICAL DRIVES book - excersise 1 Predictive Control Simulation – Three-Phase Inverter)
the code has some golbal varaibles that are declared globaly in both in the main function (in the matlab fun block) and in the file that I declared the rest of the local variables.
I connected all componants to each other but I have the error that need the glabal varaible to be declared?
  • I inclouded the code in the attachemts below
this is the error:
Global declaration not resolved to a Data Store Memory block registered via the Ports and Data Manager.
Function 'MATLAB Function' (#23.513.514), line 15, column 6:
"v"
Launch diagnostic report.
Component:MATLAB Function | Category:Coder error
Global declaration not resolved to a Data Store Memory block registered via the Ports and Data Manager.
Function 'MATLAB Function' (#23.524.525), line 15, column 17:
"L"
Launch diagnostic report.
Component:MATLAB Function | Category:Coder error
Global declaration not resolved to a Data Store Memory block registered via the Ports and Data Manager.
Function 'MATLAB Function' (#23.526.528), line 15, column 19:
"Ts"
Launch diagnostic report.
Component:MATLAB Function | Category:Coder error
Global declaration not resolved to a Data Store Memory block registered via the Ports and Data Manager.

채택된 답변

siv1
siv1 2020년 1월 18일
편집: siv1 2020년 1월 18일
Hi, you need to place the m file data into the main matalb function(mpc controller). That solved the problem for me. And don't forget to initialize x_opt. Contact me if you have any issues further. my mail id is ee18resch01005@iith.ac.in
  댓글 수: 1
Mohamed
Mohamed 2020년 1월 21일
Thank you Siv1 for your help and answre, it did not work for me, can you please give more detailes. because I have incloded the function in the same directory and I declared the x_opt but still not working .
thank you

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

추가 답변 (0개)

커뮤니티

더 많은 답변 보기:  Power Electronics Community

카테고리

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

제품


릴리스

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by