How to adjust value from matlab-mfile and feedback in simulink

조회 수: 97 (최근 30일)
I am having a model in simulink uploaded at:
<http://www.freeimagehosting.net/79moh. >
In the first iteration the model should take value from matlab mfile and calculate error for Pid as e=r-i where 'i' is the value taken from matlab mfile but after that it should take feedback and calculate the error as e=r-y where 'y' is the value of feedback from space state. How can I do that in simulink. Any guidance?

채택된 답변

Muruganandham Subramanian
Muruganandham Subramanian 2012년 12월 5일
편집: Muruganandham Subramanian 2012년 12월 5일
step1:Initialize all i/p data in m-file & variable 'i'
step2: use 'sim()' command to run your model
step3: store the value of 'y' in baseworkspace by 'To workspace' block from model
step4:calculation
  댓글 수: 8
Beenish Mazhar
Beenish Mazhar 2012년 12월 6일
Thank you sir for your reply.Sir in the link given above I have done the same work and I have used the simin command because it is not necessary that initial value taken from mfile is zero, it may vary i.e simin initial value could be 2 or 5 etc.Kindly now tell me how to resolve the issue
Muruganandham Subramanian
Muruganandham Subramanian 2012년 12월 6일
Initial condition in unit delay is user specified. so you can give any value like 0 or 2 or 5 or etc...

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

추가 답변 (0개)

카테고리

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

제품

Community Treasure Hunt

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

Start Hunting!

Translated by