Simulink To workspace outputs empty arrays

조회 수: 18 (최근 30일)
Mika Fabricius
Mika Fabricius 2023년 3월 20일
편집: Mika Fabricius 2023년 4월 2일
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?

답변 (1개)

Ganapathi Subramanian
Ganapathi Subramanian 2023년 3월 31일
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
Mika Fabricius
Mika Fabricius 2023년 4월 2일
편집: Mika Fabricius 2023년 4월 2일
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

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 General Applications에 대해 자세히 알아보기

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by