TO WORKSPACE FROM MATLAB
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Hi,
I have a vector V=[1 2 2 1 2 1 2 1] in the workspace and I have to transfer in Simulink as a signal.
By using the block "from Workspace", I get a continue signal and not a dicretize one (as in the figure below)
![Cattura.PNG](https://www.mathworks.com/matlabcentral/answers/uploaded_files/228177/Cattura.png)
Does someone know how to obtain the discretized value in simulink? I mean the signal with 1 and 2, that will enter a switch block
2 comentarios
Respuesta aceptada
Raj
el 10 de Jul. de 2019
Create the data as a timeseries. See details here:
For your case:
t=[0 1 1 3 3 4 4 5 5 6 6 7 7 9 9 10]
y=[1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2]
ts=timeseries(y,t)
plot(ts) % just to confirm that this is what you want
Then in the 'from workspace' block of your Simulink model, enter 'ts' as the data to be imported.
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Sources en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!