0
votes

how to use the "from workspace block in simulink" ?

I have tried using the from workspace block by given 10*2 matrix as input. it is appending some extra data along the data I have given .

and I have such 3 such blocks and want to know how I merge them.

2

2 Answers

1
votes

Read the documentation. Simulink is time-based so the data in your From Workspace block must be as a function of time. Does your 10 x 2 matrix represent a signal as a function of time? If so, it needs to be as follows:

A two-dimensional matrix:

  • The first element of each matrix row is a time stamp.
  • The rest of each row is a scalar or vector of signal values.

The leftmost element of each row is the time stamp of the value(s) in the rest of the row.

10 values isn't very much, it's likely that Simulink will need additional data points at intermediate times, if you have the Interpolate Data check box ticked. If not, "the current output equals the output at the most recent time for which data exists".

0
votes

I think you may have a misunderstanding of the variables intended to be read by the FromWorkspace block.

The block expects a time series defining the value at various points in the simulation.

The From Workspace block help should point you in the right direction on this. Mathworks Help Documentation

I believe that something like the following would work for you:

>> WorkspaceVar.time=0;
>> WorkspaceVar.signals.values=zeros(10,2)
>> WorkspaceVar.signals.dimensions = [10,2]