Error in using variable from MATLAB workspace to Simulink?
Ahora está siguiendo esta pregunta
- Verá actualizaciones en las notificaciones de contenido en seguimiento.
- Podrá recibir correos electrónicos, en función de las preferencias de comunicación que haya establecido.
Se ha producido un error
No se puede completar la acción debido a los cambios realizados en la página. Vuelva a cargar la página para ver el estado actualizado.
0 votos
Comparte un enlace a esta pregunta
Respuesta aceptada
0 votos
Comparte un enlace a esta respuesta
- 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 comentarios
Comparte un enlace a este comentario
Comparte un enlace a este comentario
Comparte un enlace a este comentario
Comparte un enlace a este comentario
- 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)
Comparte un enlace a este comentario
- 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
Comparte un enlace a este comentario
- 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.
Comparte un enlace a este comentario
Comparte un enlace a este comentario
- 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
Comparte un enlace a este comentario
Comparte un enlace a este comentario
- Regarding auto prompt to create variables, (e.g. in R2022b)
- Regarding workspace
- Regarding Simulink fundamentals document
Comparte un enlace a este comentario
Comparte un enlace a este comentario
Más respuestas (1)
0 votos
Comparte un enlace a esta respuesta
3 comentarios
Comparte un enlace a este comentario
Comparte un enlace a este comentario
Categorías
Más información sobre Event Functions en Centro de ayuda y File Exchange.
Etiquetas
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Seleccione un país/idioma
Seleccione un país/idioma para obtener contenido traducido, si está disponible, y ver eventos y ofertas de productos y servicios locales. Según su ubicación geográfica, recomendamos que seleccione: .
También puede seleccionar uno de estos países/idiomas:
Cómo obtener el mejor rendimiento
Seleccione China (en idioma chino o inglés) para obtener el mejor rendimiento. Los sitios web de otros países no están optimizados para ser accedidos desde su ubicación geográfica.
América
- 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)
