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!