Initialize MATLAB-Function
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Saeed Ahmadzadeh Mahboobi
le 19 Nov 2020
Réponse apportée : Ameer Hamza
le 19 Nov 2020
Hello
I've read in the previous questions, that initializing a MATLAB-Function in Simulink is done like:
persistent j;
if isempty(j)
j = 1;
end
And I have done so. Then I use the value j.
The problem is, as I want to run the simulink model, I get the following error:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/419508/image.jpeg)
Any ideas how to solve this problem?
Thanks.
0 commentaires
Réponse acceptée
Ameer Hamza
le 19 Nov 2020
This is not really an error. It just tells that you need to change the sampling rate of this block from continuous to discrete. Just click the "Fix" button on the first box under "Suggested actions" and the error will be fixed.
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Sources dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!