Adaptive Control Law Design, s-function not working, please help

for the Adaptive Control Law Design,,the s-function implemented simulink file is attached,,but the chap1_1plot.m file giving error of Unrecognized function or variable 't'. kindly help,,how to rectify this problem

2 件のコメント

Miguel Angel Mendieta Sarmiento
Miguel Angel Mendieta Sarmiento 2022 年 12 月 14 日
Hello, may you share the files? I have the book, but I need the example codes.
Farhan Manzoor
Farhan Manzoor 2022 年 12 月 15 日
example codes are given

サインインしてコメントする。

 採用された回答

Farhan Manzoor
Farhan Manzoor 2022 年 12 月 18 日

0 投票

Thank you @Sam Chak kindly check the video attached

その他の回答 (1 件)

Sam Chak
Sam Chak 2022 年 12 月 13 日

1 投票

Let us know if the following suggestions works.
Step 1: In all S-function Blocks, leave the field of the S-function parameter "empty", or else you can't run the Simulink file.
Step 2: In all To Workspace Blocks, the save format should be changed to "Array", or else you can't create the plots based on the code in "Chap1_1plot.m"
Step 3: Run the Simulation (mdl file). Then run "Chap1_1plot.m" file to plot the two figures.
Figure 1
Figure 2

6 件のコメント

Farhan Manzoor
Farhan Manzoor 2022 年 12 月 16 日
編集済み: Farhan Manzoor 2022 年 12 月 16 日
Problem not resolved,,again same error,,have you run the code which i have given? @Sam Chak
Sam Chak
Sam Chak 2022 年 12 月 16 日
編集済み: Sam Chak 2022 年 12 月 16 日
Of course, I have (1) downloaded, (2), fixed the blocks, and (3) ran the files. Else, I cannot produce the plots in my Answer above.
But I'm unsure whether or not you removed the S-function parameter 't' for ALL S-function blocks. What changes did you make to ALL S-function blocks? Changing ONE S-function block is incomplete.
However, you can try these files.
Let me if they work exactly as suggested in my Answer.
Farhan Manzoor
Farhan Manzoor 2022 年 12 月 17 日
Thank you @Sam Chak I am following all the instruction given by you. but still not able to run the plot file,,kindly check the pictures given forthe problem i am facing
Sam Chak
Sam Chak 2022 年 12 月 17 日
Now I see what happened. Mostly probably you overlooked my instruction in "Step 2" in my Original Answer above.
For all "To Workspace" Blocks, make sure that the Save format is set to "Array" form. You should be able to send the variables to MATLAB Workspace now.
Let me know if works.
Sam Chak
Sam Chak 2022 年 12 月 18 日
編集済み: Sam Chak 2022 年 12 月 18 日
My bad, I finally realized what happened. It's the setting in your Model Configuration Parameters. It exports all output signals as a single out object.
Step 2b: In the Model Config menu, select Data Import/Export, and the Uncheck "Single simulation output" should fix the issue.
Farhan Manzoor
Farhan Manzoor 2022 年 12 月 18 日
Problem Solved Thank you very much @Sam Chak

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeSimulink についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by