I cannot call parameter value from workspace to Simulink matlab function block
2 次查看(过去 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!