ENGIN 7 Study Guide - Midterm Guide: Row And Column Vectors, Pentagram, Xscale

110 views6 pages
18 Feb 2016
School
Department
Course

Document Summary

To use the struct function, type >> struct( fieldname", fieldvalues, . ) To fill in the fields of a struct with a double array, set the field values equal to an array containing cells that contain your desired arrays of values. To select the specific number value of each array within a certain field, create an array using [struct(1). fieldname(#), struct(2). fieldname(#), etc. ] >> isfield(structname, fieldname") returns 1 if fieldname is a field, and 0 if not. Must call the struct first, then the elements within the field. Structs are sized as columns. (1 x n format) Calling a field of a struct will retrieve each entry one by one and rewrite ans each time. To open entries of structs (to modify with built-in functions or direct assignment), use curly brackets to access contents of struct entries nested cells. Must use curly brackets each time to enter a cell.