how to find a output value at time t for a input value at time t in simulink
9 views (last 30 days)
Show older comments
I am simulating a model where i need to measure continuous values of output variable Y which im going to use as my feedback to a function block. The inputs to the function block are the output variable Y and and input variable X. Both the values keep fluctuating. I want to find the output value Y at a particular time t at which the input value X shows a constant value z.
For example: The input values keep increasing initially X=(1 2 3 4 5 6 7 8 9 ...). I want to find the output value Y at the time where X shows 7. Please note im doing this in simulink.
How can i do this?
Thank You
1 Comment
Raj
on 3 Jul 2019
I am not sure If i understand your question correctly. To me, it looks like you want to get your output value at a particular value of input. That's it. You can easily do this is just by connecting both to a scope and get overlapping plots. You can find the output values at any given value of input. Is this what you are looking for?
Answers (1)
Jalaj Gambhir
on 17 Jul 2019
Hi,
From what is assumed, you want to analyze and use the values of the input (X) and the output (Y). This can be done by adding a scope block to visualize the output as well as log them into your workspace for further use.
After adding a scope block, open the same, and go to View --> Configuration Properties. Modify the number of input ports as required (2 in your case). In the ‘Logging’ tab, check the ‘Log data to workspace’ checkbox and provide the output variable name and the save format. Save the changes.
After pressing the ‘Run’ button, a variable will be created in your base workspace with the provided name. You can access the values by ‘out.ScopeData.signals(1).values’ or ‘out.ScopeData.signals(2).values’ (if default name was provided in the ‘Logging’ tab). These values can be further used as required.
0 Comments
See Also
Categories
Find more on Simulink Functions in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!