- Add a “MATLAB Function” block to the model.
- Use a “Bus” block to combine all outputs from the 'parse motion' block.
- Connect the “Bus” created in Step 2 to the input port of the “MATLAB Function” block from Step 1.
- Link the output of the “MATLAB Function” block from Step 1 to the input port of the “parse motion” block.
- Set the priority of the “MATLAB Function” block from Step 1 higher than that of the “parse motion” block.
- Incorporate domain-specific logic into the newly created “MATLAB Function” block and assign initial data to the relevant properties.
How to implement real-time input using a MATLAB Function block
6 次查看(过去 30 天)
显示 更早的评论
Hello, I am currently researching the control of a Stewart platform simulation. I would like to input the necessary values by dividing them by the step size and using a MATLAB function block to deliver the input values in real-time. Is it possible to receive the calculated input values from a script file into the function block and deliver these values in real-time for each step according to the simulation time?
I want to input the values calculated in the script file into the MATLAB function block as data, with time and step settings, and have the block calculate the 8 prism joint displacements. These displacements should be divided into steps over the simulation time and delivered in real-time.
0 个评论
回答(1 个)
Jaimin
2024-9-27
Hi @석준
In order to obtain the calculated input values from a script file within the function block and provide these values in real-time for each simulation step, I have a workaround that you might consider trying.
Please follow these steps:
For more information on “MATLAB Function” and “Bus” Block you can refer following documentations:
I hope this will be helpful.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Troubleshooting in Simulink Real-Time 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!