I cannot call parameter value from workspace to Simulink matlab function block
4 ビュー (過去 30 日間)
古いコメントを表示
Hello,
I want to call a parameter value from workspace to Simulink matlab function block. But, it doesn't work.
function y = AAA( var1)
BB= var1
CC = 'parameter in workspace' * BB
y=CC
0 件のコメント
回答 (1 件)
Paul
2023 年 1 月 13 日
Hi @mg
Make the function like this:
function y = AAA( var1,param1)
BB= var1
CC = param1 * BB
y=CC
param1 will not show up as an input to the Matlab Function block in the block diagram.
Set the value of param1 in your base workspace and then simulate your model
>> param1 = 5;
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Simulink Functions についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!