how to use matlab function in simulink when there are several while loops in function?
Afficher commentaires plus anciens
I was trying to execute a matlab function in simulink and i found below error.
Errors occurred during parsing of MATLAB function 'MATLAB Function'. I tried to debug it myself and found that if i remove While loop from it then every thing works simply fine.
One more error appeared and that was Variable 'HC' is undefined on some execution paths. the variable HC get its value in a while loop only and some execution path it is coming as undefined. So is there any problem if a loop is executed through a matlab function in simulink or the problem is something else? whats the solution for this?
I am not able understand this problem and while loop is inevitable part of that code. please suggest the solution so that i can run this code as part of simulink simulation.
1 commentaire
TAB
le 12 Déc 2012
Please post your code ?
Réponses (1)
Walter Roberson
le 12 Déc 2012
0 votes
Just assign some value to the variable before the while loop starts.
Catégories
En savoir plus sur Simulink dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!