Can I use as Input at Simulink a equation?
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hello,
Can I use this equation as input at Simulink? I would appreciate any help.
Simulink block:
0 commentaires
Réponse acceptée
Walter Roberson
le 24 Déc 2015
Use a MATLAB Function Block, or an Interpreted MATLAB Block
5 commentaires
Walter Roberson
le 29 Déc 2015
"Interpreted MATLAB Function
Supports only a single input and a single output port. Use a Mux block to combine the inputs and a Demux block to separate the outputs if you pass multiple signals into or out of these blocks."
For the Interpreted MATLAB Function, I am not at the moment sure whether it is permitted to name the input anything other than u. It might need to look something like,
sum( u(:,2).*cos(2.*pi.*u(:,3).*u(:,1)+u(:,4) )
But since this is a scalar result involving only values from your workspace, it is not clear to me why you do not just calculate the scalar in MATLAB ? Is your mention of a random number generator intended to be a hint that you want to try random phases? Keep in mind that if you use random numbers inside an algebraic loop then the calculation is not going to be differentiable and Simulink would not be able to calculate consistent values.
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Simulink Functions 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!