Versions Compared

Key

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

Step 3: Structure of Handles

Introduction

MATLAB assigns a handle to every graphics object it creates. One can use this handle to subsequently change the object's properties. The guihandles function allows the user to create a structure containing the handles of the objects in a figure. This feature is used in redAnTS to create a structure containing the handles of the objects in the graphical user interface (GUI) as shown below.

...

The user can augment this "handles" structure with any data. Taking advantage of this feature, redAnTSuses the handles structure to store information about the mesh, material properties, displacements, strains, stresses, etc. In other words, the handles structure is the container that is used to store this FEA data. This data can be accessed and modified using the guidata function as is explained below.

Handles structure in redAnTS

Download and unpack redAnTS if you haven't done so already. Bring up PostProcessMenuFiles/CalcStrainStress.min the MATLAB editor. This function is used to calculate the element strain and stress values from the nodal displacements. This is one of the functions that you need to modify to add post-processing capabilities to your version of redAnTS. Let's take a closer look at the following two statements in this function.

...

will give you a row vector containing the x-coordinates of all the nodes. You can visualize the handles structure as per the figure below.

Investigate thehandles structure using the debugger

You can set use the debugger to investigate further what the fields of the handles structure look like. In the MATLAB editor, add a breakpoint in CalcStrainStress.m at the statement handles=guidata(fighandle). You can add a breakpoint by clicking to the left of the line. A red circle should appear as shown below.

...