Error in using variable from MATLAB workspace to Simulink?
Sie verfolgen jetzt diese Frage
- Aktualisierungen können Sie in Ihrem Feed verfolgter Inhalte sehen.
- Je nach Ihren Kommunikationseinstellungen können Sie auch E-Mails erhalten.
Es ist ein Fehler aufgetreten
Da Änderungen an der Seite vorgenommen wurden, kann diese Aktion nicht abgeschlossen werden. Laden Sie die Seite neu, um sie im aktualisierten Zustand anzuzeigen.
0 Stimmen
Teilen Sie einen Link zu dieser Frage
Akzeptierte Antwort
0 Stimmen
Teilen Sie einen Link zu dieser Antwort
- 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 Kommentare
Teilen Sie einen Link zu diesem Kommentar
Teilen Sie einen Link zu diesem Kommentar
Teilen Sie einen Link zu diesem Kommentar
Teilen Sie einen Link zu diesem Kommentar
Teilen Sie einen Link zu diesem Kommentar
- 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)
Teilen Sie einen Link zu diesem Kommentar
- 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
Teilen Sie einen Link zu diesem Kommentar
- 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.
Teilen Sie einen Link zu diesem Kommentar
Teilen Sie einen Link zu diesem Kommentar
- 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
Teilen Sie einen Link zu diesem Kommentar
Teilen Sie einen Link zu diesem Kommentar
Teilen Sie einen Link zu diesem Kommentar
- Regarding auto prompt to create variables, (e.g. in R2022b)
- Regarding workspace
- Regarding Simulink fundamentals document
Teilen Sie einen Link zu diesem Kommentar
Teilen Sie einen Link zu diesem Kommentar
Weitere Antworten (1)
0 Stimmen
Teilen Sie einen Link zu dieser Antwort
3 Kommentare
Teilen Sie einen Link zu diesem Kommentar
Teilen Sie einen Link zu diesem Kommentar
Teilen Sie einen Link zu diesem Kommentar
Kategorien
Mehr zu Event Functions finden Sie in Hilfe-Center und File Exchange
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Website auswählen
Wählen Sie eine Website aus, um übersetzte Inhalte (sofern verfügbar) sowie lokale Veranstaltungen und Angebote anzuzeigen. Auf der Grundlage Ihres Standorts empfehlen wir Ihnen die folgende Auswahl: .
Sie können auch eine Website aus der folgenden Liste auswählen:
So erhalten Sie die bestmögliche Leistung auf der Website
Wählen Sie für die bestmögliche Website-Leistung die Website für China (auf Chinesisch oder Englisch). Andere landesspezifische Websites von MathWorks sind für Besuche von Ihrem Standort aus nicht optimiert.
Amerika
- América Latina (Español)
- Canada (English)
- United States (English)
Europa
- 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)
