Bus signals from simulink functional block
1 次查看(过去 30 天)
显示 更早的评论
Hey everyone,
I am trying to get bus data in and out of matlab function block in simulink. Here's a simple model I have tried to test to it out:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/785693/image.png)
The function is defined as :
function y = fcn(b1, b2)
y.b1 = b1 - b2;
y.b2 = b1 + b2;
I have created a simulinkBus; "x" as shown in the image below:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/785698/image.png)
But I keep getiing this error, when I run my model:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/785703/image.png)
What am I doing wrong here?
0 个评论
回答(1 个)
Alex Alex
2021-11-2
look here
https://www.mathworks.com/help/simulink/ug/attach-bus-signals-to-matlab-function-blocks.html
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Interactive Model Editing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!