Why do I get an error "Division by zero" when I switch to normal mode but No error by using accelerator mode?
13 次查看(过去 30 天)
显示 更早的评论
Hello,
I use a simulation model which contains a number of reference models and in order to speed up the performance I changed the simulation mode from Normal to Accelerator.
The simulation getting faster but recently I get on erro when I swicht back to Normal mode.
My question is:
Why do I get an error "Division by zero" when I switch to normal mode but No error by using accelerator mode?
Has anybody On Idea how to solve this Issue that I continue to use accelerator mode without having any software bug?
4 个评论
回答(2 个)
Pratheek
2023-3-1
Hi Noureddine Doumi,
When you change your simulation mode from Normal to Accelerator to speed up the simulation, the simulation behaves differently in Accelerator mode. While the simulation runs faster, certain errors, such as "Division by zero," may be masked or not triggered in the Accelerator mode. This can happen because the Accelerator mode optimizes the way calculations are performed differently than the Normal mode.
If you switch back to Normal mode and get an error, it may be because a variable or constant has a value of zero, which is causing a "Division by zero" error. To fix the error, you need to identify the variable or constant causing the error and adjust its value so that it is not zero. You can also modify your simulation code to handle the "Division by zero" case by checking for a zero value before performing the division operation.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Manual Performance Optimization 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!