MATLAB POLYSPACE RELEASE NOTES Manual de usuario Pagina 154

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 240
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 153
4 Programming
C=
'A'
'rolling'
'stone'
'gathers'
'momentum.'
You can convert a padded character array to a cell array of strings with
C = cellstr(S)
and reverse the process with
S = char(C)
Structures
Structures are multidimensional MATLAB arrays with elements accessed by
textual field designators. For example,
S.name = 'Ed P lum';
S.score = 83;
S.grade = 'B+'
creates a scalar structure with three fields:
S=
name: 'Ed Plum'
score: 83
grade: 'B+'
Like everything else in MATLAB, structures are arrays, so you can insert
additional elements. In this case, each element of the array is a structure with
several fields. The fields can be added one at a time,
S(2).name = 'Toni Miller';
S(2).score = 91;
S(2).grade = 'A-';
or an entire element can be added with a single statement:
S(3) = struct('name','Jerry Garcia',...
'score',70,'grade','C')
4-16
Vista de pagina 153
1 2 ... 149 150 151 152 153 154 155 156 157 158 159 ... 239 240

Comentarios a estos manuales

Sin comentarios