- 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
조회 수: 5 (최근 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!