- First add MATLAB function block in Simulink.
- Then Click on MATLAB function block.
- Then you will see a function like this.
Fcn convert to Matlab Function in Simulink
19 次查看(过去 30 天)
显示 更早的评论
I use R2022a version of MATLAB, Simulink. However, I have to use fcn but this version doesn't have this function. I have to Matlab Function. Such as I write sqrt(3)*u(1)*u(3)/u(2) for fcn. How to write this function with Matlab Function using Simulink? Can you help me for this problem?
0 个评论
回答(1 个)
Sachin
2023-2-15
编辑:Sachin
2023-2-15
I understand that you are trying to write function using MATLAB function using Simulink. Referring the following information might be of good help to you.
function y = fcn(u)
y = u;
4. Now, replace y = u ; with your equation. See below
function y = fcn(u)
y = sqrt(3)*u(1)*u(3)/u(2);
Here u is input to MATLAB function block and y is output.
For more information about MATLAB function block, refer to the following page
Regards
Sachin
另请参阅
类别
在 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!