Error in using variable from MATLAB workspace to Simulink?
Vous suivez désormais cette question
- Les mises à jour seront visibles dans votre flux de contenu suivi.
- Selon vos préférences en matière de communication il est possible que vous receviez des e-mails.
Une erreur s'est produite
Impossible de terminer l’action en raison de modifications de la page. Rechargez la page pour voir sa mise à jour.
0 votes
Partagez un lien vers cette question
Réponse acceptée
0 votes
Partagez un lien vers cette réponse
- it is a signal, just a constant signal; in that case use 0 as the first column (time); and configure From Workspace to "hold" the signal; OR
- it is something you want to treat as a global variable or datastore variable; OR
- it is something you want to use as a parameter (for example gain for a block)
14 commentaires
Partagez un lien vers ce commentaire
Partagez un lien vers ce commentaire
Partagez un lien vers ce commentaire
Partagez un lien vers ce commentaire
- know the complete paths to all occurances of the constant block that should use the same value, and set_param() each of them to the new numeric value; or
- define the value of the constant blocks in terms of a name, and use the kinds of techniques I linked to in order define the name as a param (in which case you do not need to know the paths to any blocks)
Partagez un lien vers ce commentaire
- run simulation and send Fs to workspace
- from Fs compute the value of a new variable called avg_rocof
- run the simulation again using the value of avg_rocof
Partagez un lien vers ce commentaire
- There is no need to mention global variable or datastore variable.
- There is no need to mention set_param(). The need for it would be the same, if using Constant block or "From Workspace" block.
- There is no need to explain the difference between "push" and "pull", if there are any.
- Signal object is irrevelant. It is used to define signal property, not to import value.
Partagez un lien vers ce commentaire
Partagez un lien vers ce commentaire
- Open simulink
- Create a blank model
- Create a block diagram with a Constant block feeding a To Workspace block
- Double click the Constant block, specify cvalue as the block parameter for "Constant value"
- Click OK on the Block Paramters for the Constant block
- At the matlab command prompt, assign a value to cvalue ">> cvalue = 6.23"
- Simulate the model by clicking the Run button
- After the simulation is complete, what does this command show: >> out.simout.Data
Partagez un lien vers ce commentaire
Partagez un lien vers ce commentaire
- Regarding auto prompt to create variables, (e.g. in R2022b)
- Regarding workspace
- Regarding Simulink fundamentals document
Partagez un lien vers ce commentaire
Partagez un lien vers ce commentaire
Plus de réponses (1)
0 votes
Partagez un lien vers cette réponse
3 commentaires
Partagez un lien vers ce commentaire
Partagez un lien vers ce commentaire
Catégories
En savoir plus sur Event Functions dans Centre d'aide et File Exchange
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Sélectionner un site web
Choisissez un site web pour accéder au contenu traduit dans votre langue (lorsqu'il est disponible) et voir les événements et les offres locales. D’après votre position, nous vous recommandons de sélectionner la région suivante : .
Vous pouvez également sélectionner un site web dans la liste suivante :
Comment optimiser les performances du site
Pour optimiser les performances du site, sélectionnez la région Chine (en chinois ou en anglais). Les sites de MathWorks pour les autres pays ne sont pas optimisés pour les visites provenant de votre région.
Amériques
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
