It's possible to load the generated triangle wave data from workspace to an input block in the simulink model using the input configuration parameter/ data import (export) option.
To do this,you need to select the external input specification in the edit box of input block and click apply.
Alternately, simulink can also generate square wave data using the default / built-in function blocks available in the simulink object browser.
Simulink provides several ways to import data from MATLAB or other sources. One way is to use the "From Workspace" block in Simulink.
Here are the steps you can follow:
In your MATLAB code, save the graph data as a variable in the workspace. For example, if your graph data is stored in a variable named "myGraphData", you can save it to a .mat file using the following command: save ('myGraphData.mat', 'myGraphData');
In Simulink, add a "From Workspace" block to your model. This block allows you to import data from the MATLAB workspace.
Double-click on the "From Workspace" block to open its dialog box. In the "Data" field, enter the name of the variable that contains your graph data (in this case, "myGraphData").
Set the "Sample time" parameter to the appropriate value depending on how often you want the data to be sampled.
Connect the output of the "From Workspace" block to your logic.
Run the simulation.
Your logic should now receive the graph data as input from the "From Workspace" block.
You can use the "From Workspace" block in Simulink to input your generated triangle wave from MATLAB. Here are the steps you can follow:
Generate your triangle wave in MATLAB and save it as a variable in the workspace. For example, if your triangle wave is saved as a variable named "triangleWave", you can save it to a .mat file using the following command: save('triangle_wave.mat', 'triangleWave');
In your Simulink model, add a "From Workspace" block.
Double-click on the "From Workspace" block to open its parameters dialog box.
In the "Data" field, enter the name of the variable that contains your triangle wave (in this case, "triangleWave").
Set the "Sample time" parameter to the appropriate value depending on how often you want the data to be sampled.
Connect the output of the "From Workspace" block to the input of your simulink model.
Run the simulation.
Your triangle wave should now be used as input to your Simulink model. Let me know if you have any further questions or if there's anything else I can help you with!