フィルターのクリア

Cost of Modwpt function

1 回表示 (過去 30 日間)
Abhishek Pandey
Abhishek Pandey 2022 年 6 月 6 日
回答済み: Sai Pavan 2023 年 10 月 18 日
Hello,
I have been trying to use the "modwpt" function in a MATLAB function block in a HIL system running real-time. I am encountering overruns at a sample time of 125e-6. This sample time is quite large for application and I would like to go lower.
I would like to understand the cost of the "modwpt" function, since removing the function reduces the computation time by a significant amount.
How can I understand or compute this?
  1 件のコメント
Abhishek Pandey
Abhishek Pandey 2022 年 6 月 10 日
Hey Mathworks team,
any help will be appreciated!
Thank you,
Abhishek

サインインしてコメントする。

回答 (1 件)

Sai Pavan
Sai Pavan 2023 年 10 月 18 日
Hi Abhishek,
I understand that you want to know the cost of using the “modwpt” function.
To understand the computational cost of the "modwpt" function in MATLAB, you can use the MATLAB Profiler tool. The Profiler provides information about the execution time and resource usage of your code, which can help you identify performance bottlenecks.
Please follow the below workflow to know the cost of “modwpt” function:
  • Open the MATLAB Profiler by typing profile viewer in the MATLAB Command Window.
  • In the Profiler window, click on the "Start Profiling" button to start the profiling session.
  • Run your MATLAB code that includes the "modwpt" function.
  • Once your code execution is complete, click on the "Stop Profiling" button to stop the profiling session.
  • The Profiler window will display a summary of the profiling results, including the function call tree, execution time, and other metrics.
  • In the function call tree, you can navigate to the "modwpt" function to see its individual execution time and the functions called within it.
Keep in mind that the computational cost of the "modwpt" function can vary depending on the input data and the specific parameters used. It's recommended to profile your code with representative inputs to get a more accurate understanding of the function's cost in your specific use case. This can help you gain insights into the computational cost of the "modwpt" function and identify potential optimizations to reduce the execution time in your real-time HIL system.
Please refer to the below documentation to learn more about profile execution time for functions: https://www.mathworks.com/help/matlab/ref/profile.html
Hope it helps.
Regards,
Sai Pavan

製品


リリース

R2019a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by