フィルターのクリア

Can the set_param command store integers instead of variables?

1 回表示 (過去 30 日間)
Affan
Affan 2013 年 3 月 5 日
Hi, so I am trying to change a value in a constant block of my Simulink model. The command I use is :- set_param('Driver/APPcont','Value','50')
The command works but the problem is the way the answer is stored. It stores it in the form of a variable while I need it in the form of an integer. For example when I use the get_param as shown:-
x=get_param('Driver/APPcont','Value') I get the answer as x='50'. I need the answer to be 50 without the quotes. I understand the set_param command is mainly used for variables but is there a way to change the answer to an integer from without the use of the quotes?
Appreciate the help!

採用された回答

the cyclist
the cyclist 2013 年 3 月 5 日
If the output x is a string, then
>> xnum = str2num(x)
should work.
  1 件のコメント
Affan
Affan 2013 年 3 月 5 日
That works for me. Thank you!

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

その他の回答 (0 件)

カテゴリ

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