Extracting data from simout MATLAB work space

72 vues (au cours des 30 derniers jours)
R Hebi
R Hebi le 20 Déc 2019
Hi
I want to extract data based on the time
I have a sumilink Model which will generated the following data table
This will run between 0 min to 500 mins
I want to preform a specific calculation for the data that occur between 0 to 80 min

Réponse acceptée

Jim Riggs
Jim Riggs le 20 Déc 2019
Modifié(e) : Jim Riggs le 20 Déc 2019
simout is a timeseries structure.
I like to extract separate vectors from the structure, for example:
t = timout.time(simout.time < 80);
This will give you the time vector for all times less than 80.
You can get the associated data for this time vector with:
col1 = simout.data(simout.time<80,1); % get column 1 from data where time < 80
col2 = simout.data(simout.time<80,2); % get column 2 from data where time < 80
(if your time is scaled in seconds, then obviously you want time < 80*60 seconds)

Plus de réponses (1)

Chaman Dewangan
Chaman Dewangan le 26 Juin 2021
to workspace block is used to send data from Simulink to workspace. In this block parameters, there is an option save format. (Array, structure with time, and time series).
I am simulating in R2019 a. I get a variable out. I have named the block as simout.
For array format, out.simout is the signal value and out.tout is the time signal.
For structure with time format, out.simout.signals.values is the signal value and out.simout.time is the time signal.
For time series format, out.simout.Data(:,1); is the signal value of 1st column and out.simout.time is the time signal. Similarly, We can do for second column out.simout.Data(:,2).

Catégories

En savoir plus sur Simulink dans Help Center et File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by