How do I subtract a bunch of data created in MATLAB from another source in Simulink?
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
So, I have a simulink model with sine source input created from a time vector 't'. I now have to create a cosine source and should send it for simulation. I have done this step. But now in simulink, I have to subtract the data that was created in MATLAB from the cosine source input in Simulink. Can anyone help me with this.
0 Commenti
Risposte (1)
Prajit T R
il 22 Feb 2018
Hi Aishwarya
Your query was regarding subtraction of data in MATLAB workspace and a block in the Simulink environment. There are multiple ways to do this.
An easy method would be to use the block titled 'from workspace' in which you can mention the variable's name, sample time etc. The output from this block (which is present under Simulink -> Sources) can be used in tandem with the cosine source and subtraction would be possible.
Another method would be to navigate to Model Configuration Paramaters -> Data import/export and then tick the option for input and keep its value as [t,u]. (Replace u by your variable's name) Then you need to use an In1 block which is present under Simulink -> Sources to obtain the data from workspace.
Either ways, you would be able to subtract the two signals.
0 Commenti
Vedere anche
Categorie
Scopri di più su Prepare Model Inputs and Outputs in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!