Azzera filtri
Azzera filtri

Simulink To workspace outputs empty arrays

22 visualizzazioni (ultimi 30 giorni)
Mika Fabricius
Mika Fabricius il 20 Mar 2023
Modificato: Mika Fabricius il 2 Apr 2023
I am doing simulations on an umbilical cable, modelled as a lumped-mass-spring model.
For this I am trying to do a simulation of 1000 seconds, 2000 m cable and 201 nodes, for testing/assumption proving purposes.
The changed settings for the to workspace block, node_positoins, are: Save format = Structure with time. The rest is default.
The output I would then get should be a (n,m,t), where n are the rows, m is the coloumns and t is the timesteps, where for this case it would be (201,3,10000001), since i would have 201 nodes positions for (N,E,D) (North, East and Down reference frame) and then for 1000 seconds with a timestep of 0.0001 s gives 10000001 timesteps.
The simulation runs fine, no problems and in the SimulationOutput in MATLAB it also shows the time variable and all other model information and no error messages. But the node_positions and all other structs with the same format are empty arrays.
Should I use other formats for saving or what is the issue here?

Risposte (1)

Ganapathi Subramanian
Ganapathi Subramanian il 31 Mar 2023
Hi Mika Fabricius,
It is my understanding that you are working on umbilical cable which is modelled as a lumped mass spring model and have trouble in accessing the logged data to workspace in ‘Structure with time’ format.
In ‘Structure with time’ format, Simulink saves the model states and outputs in structures not arrays. It saves output in two top-level fields(time and signals). The ‘signals’ field contains an array of substructures, each of which corresponds to a model output port.
If the output at the corresponding output port is N*M matrix, then the ‘values’ field under ‘signals’ is a 3D array of dimension N*M*t as you have stated above. Try to access the data in the ‘values’ field inside ‘signals’ field of output variable.
Refer the below documentation to get more information regarding ‘Structure with time’.
Refer the same link above to get more information regarding various data format to log data and its conditions.
  1 Commento
Mika Fabricius
Mika Fabricius il 2 Apr 2023
Modificato: Mika Fabricius il 2 Apr 2023
Hello Ganapathi,
Thank you for your answer, I am aware of how to access the data for the different saving formats and currently I am accessing the data through the values field. Everything usually works and I can view the data in MATLAB workspace, but when I get past a certian amount of nodes in the model and run the simulation for a long enough time, then the values field is empty, even though no errors occured.
Do you know if this is because of a memory limit in MATLAB?
Best regards Mika

Accedi per commentare.


Scopri di più su General Applications 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!

Translated by