Unrecognized function or variable 'scope'. error in matlab script

1 回表示 (過去 30 日間)
Aly Said
Aly Said 2025 年 5 月 10 日
回答済み: Walter Roberson 2025 年 5 月 10 日
I run a simulink file that tunes pid controllers to obtain their optimal gains.
The simulation will go on for 20 seconds and I need to extract the time in variable "tout" which is taken from "Tmodel"
the following lines are responsible for my task:
set_param('AGC_2_Simulink_RLC1_10may25c','Solver','ODE113')
sim('AGC_2_Simulink_RLC1_10may25c', Tmodel);
tout = scope(:,1);
but I get this error: "Unrecognized function or variable 'scope'." for the last line.
Kindly I need help

採用された回答

Walter Roberson
Walter Roberson 2025 年 5 月 10 日
The model probably has "single simulation output" configured for it; https://www.mathworks.com/help/simulink/slref/simulink.simulationoutput.html

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGeneral Applications についてさらに検索

製品


リリース

R2024b

Community Treasure Hunt

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

Start Hunting!

Translated by