![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/311948/image.png)
Plot data from workspace into simulink
3 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Meddour Aissam riad
il 7 Giu 2020
Risposto: Ameer Hamza
il 8 Giu 2020
Hi there,
Simple question, i have a vector x let's say X= [ 12 13 16 29 49] , i want to plot it with a time array t=[ 1 2 3 4 5]
those two arrays are saved into worskapce , how to call them into simulink without getting this kind of results (i know i have a problem with the time array but i really don't know how to deal with it)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/311774/image.png)
0 Commenti
Risposta accettata
Ameer Hamza
il 8 Giu 2020
Define it like this in workspace
t = [1 2 3 4 5];
X = [12 13 16 29 49];
data = [t.' X.'];
and then use From Workspace: https://www.mathworks.com/help/releases/R2020a/simulink/slref/fromworkspace.html block in Simulink. In the Data field, write the variable name 'data'.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/311948/image.png)
0 Commenti
Più risposte (0)
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!