Search code examples
matlabimportbuffersimulink

import a continuous bitsream from workspace into simulink using "In" block and then buffer it using "buffer" block


how to import a bitsream form binary vector from workspace into simulink.Actually I have found that I can use simin block or In block but my binary vector is independant of time. I tried to use Const block and it works but afer that when I wanted to put my output in the Buffer block in simulink, it didn't work because the input is continuous and not discrete. So I am asking if it's a way to add time to my binary uni-dimensional without having any influence on the result?and how can I do it? Or is there another way to import this date to avoid this problem with Buffer block?

enter image description here


Solution

  • Your screenshot shows your constant block to have a sample time of Inf. As the error message suggest, you need to change that to a discrete sample time. In addition, you should also:

    • check your model is using a fixed-step solver
    • check what time step you are using for your chosen fixed-step solver (ideally the same as your constant).

    You can have multi-rate models, but you need to manage the rate transitions with Rate Transition blocks. For more details on sample times, see the documentation, in particular how to view sample time information in a Simulink model. You should probably also have a quick look at the Choose a Solver section.