0
votes

There is a structure Meas, which has a binary Signal named B_cal having time and value as its Parameters with values being a <20583*1 double> Signal. I am using this Signal in simulink through the From Workspace block with [Meas.(Meas.time),Meas.value] as the Parameter of the block. Now i Need to generate a new binary Signal which has only the first bit high(i.e. 1) and all other bits low. The Signal should be of the same dimensions as B_cal as i Need to put both the signals in an OR gate. I tried and created a vector in the Matlab Workspace :

Signal = Zeros(20583,1);
Signal(1) = 1;

And then I used a FromWorkspace block in Simulink and tried to Import this Signal by using Signal as the block Parameter. But it ives an error that the dimensions should be that of a Matrix.
Could someone tell that how to solve the Problem. Or how can i create a new Structure with the same elements but the value Signal should be as needed i.e. 1st bit high and rest low.

1
When using the matrix format (as opposed to a time series or a structure) then it must have at least 2 columns. The first column is time while the second (and subsequent) columns are the data. Based on how you've defined time fro the Meas signal, you want something like [Meas.(Meas.time) Signal].Phil Goddard

1 Answers

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:

>> Signal.time=0;
>> Signal.signals.values=zeros(20583,1)
>> Signal.signals.values(1) = 1;
>> Signal.signals.dimensions = [20583,1]