Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Let's now consider the case where we would like to create a structure to store the strain and stress values for two triangular elements.


The structure from Step 1 can be modified as per below to accommodate the second element.


We'll create the above structure by modifying the code from Step 1. Recall that the statements for creating the structure were

...

Chew over this and make sure you understand it. If need be, look up the help on the ":" operator. The matrix for the sig field can be created in a similar fashion. When using the struct function to create sigepsstruct, we now need to use the geps_val and gsig_val to assign values to the fields. The following code brings this all together.


Run your code and check the values in the Workspace. Once your code is working correctly, test extracting data from the structure.Note that you can look up the names of each field within the structure using the fieldnames() command.

...