Hi @Martin. Here is the solution and relevant images for your question. Question: How can I generate a button that initiates a rising edge within a time-based scope, while recording the resulting data as variables representing the amplitude versus time?
Solution:
To generate a button-like signal with a rising edge within a time-based scope and record the resulting data as variables representing the amplitude versus time using Simulink, you can follow the below steps:
- Open Simulink and create a new model.
- Double-click anywhere inside the model and search for "Step". This block will generate a step signal.
- Double-click anywhere inside the model and search for "Scope". This block will visualize the amplitude versus time.
- Similarly, create a "To Workspace" block and connect the output of "Step" block to the input of this "To Workspace" and "Scope" blocks.
- Double-click on the To Workspace block and specify the variable name where you want to store the data.
- Configure the Step block as follows:
- Set the "Initial Value" to 0 (or any desired initial value).
- Set the "Final Value" to the desired amplitude for the rising edge.
- Set the "Step Time" to the duration of the rising edge.
- Set the "Sample Time" to the desired time at which the rising edge should occur.
- Run the simulation by clicking the "Run" button in Simulink.
- The Scope block will display the amplitude versus time, and the data will be saved as variables with the specified name in the MATLAB workspace.
Relevant images:
Here are some images you can use as a reference. Basically, I have taken some arbitrary values and ran the simulation.
Links to Documentation:
Here are some documentation links that you can refer to for more information: