Variable Input for State Space
Mostrar comentarios más antiguos
Hello, I am working with a model in Simulink and I have the State Space. Now, the input (a temperature) is constant, but I want that that temperature varies respect on time. I have a matrix with information about that Temperature and the time that the sensor took that. Which is the best way to do that?
I would like to do something similar that the "Random Number" does, but with my data, which is not random.
Thank you so much for your help.
Respuestas (1)
Sameer
el 6 de Mayo de 2025
0 votos
Hi @Carlos
You can use your time-varying temperature data as an input in Simulink! Here are a couple of straightforward ways I have used before:
1. From Workspace block:
- Arrange your data as an N-by-2 matrix: first column is time, second is temperature.
- For example: temp_data = [time_vector, temperature_vector];
- In Simulink, add a "From Workspace" block, set its Data parameter to your matrix (e.g., temp_data), and connect it to your State-Space block.
- The block will output your temperature values at the correct simulation times, interpolating as needed.
2. 1-D Lookup Table:
- Use your time as breakpoints and temperature as table data.
- Feed simulation time (from a "Clock" block) into the lookup table, and connect the output to your State-Space block.
- This way, you have more control over interpolation/extrapolation if needed.
Both methods let you use your recorded temperature data as a dynamic input, rather than a constant.
Hope this helps!
Categorías
Más información sobre Simulink en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!