Simulink, data from vector representation.
Afficher commentaires plus anciens
Hi,
I would like to kwon how to import or introduce data in simulink, from a vector which I have got in matlab. I mean, I got tha data from a earthquake wave in a vector in matlab, which I want do is to respresent this vector in simulink, in real time in order to send the data with opc to codesys.
Thanks for your time.
Réponses (1)
Fangjun Jiang
le 21 Juil 2020
0 votes
The most common case, let's say you have a vector a=0:0.1:1.
Make it a column vector b=a'
Create a time vector to specify the time for each value, for example, t=(0:10)'
Use the "From Workspace" block, specify the data as [t b], which will give you data value 0 at time 0, value 0.1 at time t=1 second, etc.
There are other format too. Take a look at the Help document of the "From Workspace" block.
3 commentaires
jorge varona madrid
le 21 Juil 2020
Fangjun Jiang
le 22 Juil 2020
Simulation might be faster or slower than real-time depending on the model. If it is faster, you could slow it down close to real-time. See Simulink Real-Time
jorge varona madrid
le 24 Juil 2020
Catégories
En savoir plus sur General Applications dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!