Versions Compared

Key

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

...

numels = 2;%Total number of elements
for iele = 1:numelsstuffnumels

     stuff

{{}}
end
sigepsstruct = struct();

...

Another thing: eps_val and sig_val above are row vectors. But the epsfield is a matrix. We'll create this matrix as follows: after each row of the matrix is calculated, we will "push" it into the appropriate row of the matrix. Let's call this matrix geps_val, the g prefix standing for global. The following assignment will push the current eps_val vector into the second row of the matrix.

geps_val(2, _(smile) _ = eps_val;

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.

...