How to read a variable in set_param function?

1 回表示 (過去 30 日間)
loay al-azri
loay al-azri 2019 年 2 月 21 日
回答済み: Monika Jaskolka 2021 年 3 月 1 日
Iam having aproblem reading a value from a file and put it inside Set_param function. This is my code where here i get the value of A from a txt file but i want to put A in Set_param. when the simulink open it shows A not the value of A in the model.
open_system('Transient.slx')
A = dlmread('C:\xampp\htdocs\RCE\MATLAB\FYP_expirement\SpeedControl\exp_value.txt');
set_param('Transient/Gain','Gain','A')

回答 (1 件)

Monika Jaskolka
Monika Jaskolka 2021 年 3 月 1 日
set_param('Transient/Gain', 'Gain', A)

カテゴリ

Help Center および File ExchangeProgrammatic Model Editing についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by