readmatrix error handling in Simulink Matlab function
Mostra commenti meno recenti
I'm using the 'readmatrix' function inside a matlab function block in Simulink to read an Excel file that is often updated by an external software.
Simulink is sometimes crashing because it doesn't has access to the Excel file but I want Simulink to ignore this error and retry to read the file in the next simulation step.
I tried using a try/catch statement but this seems not to be available in Simulink.
All it needs to do is to try to access the file again instead of throwing an error and breaking the simulation, anyone who can help witrh this?
Thanks!
2 Commenti
dpb
il 17 Ago 2023
Where did you put the try...catch block and what does your .s function return if it can't read the file this step; maybe that's the problem that Simulink can't handle an empty return (just guessing, we can't see your simulation nor your code from here).
Damien Pecher
il 18 Ago 2023
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Spreadsheets in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!