How do I load data from the MATLAB workspace to Simulink using the From Workspace Block?
How can I import data from MATLAB to Simulink ?
Best Answer
The From Workspace block in Simulink allows you to read 1-D and 2-D signals into Simulink. The examples provided in the attached Tech Note 1902 illustrate the different ways you can use the From Workspace block to read signals from the MATLAB workspace.
If you want to use a=[1 0 1] as a constant, then use constant block. To use it as a signal you can use a from workspace block. In this case like indicated in the help, the first element of each row correspond to a time stamp. You can write for example
a=[0 1 0 1];
The first element of a corresponds to a time 0. the output will be [1 0 1]
Best Answer