structSearch - % array containing every structure from the...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Sheet1 Page 1 %========================================================================== % Problem 2. Searching through a structure array %-------------------------------------------------------------------------- % % Problem Statment: % % Write a function named structSearch that takes in a structure array, a % fieldname, and a value. The function should return a new structure
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: % array containing every structure from the original array with a % matching fieldname containing the specified value. % % Note: the specified will only contain scalar numeric values. % function ans = structSearch(S, F ,V) x = 1 y = 1 [r c] = size(S) for x = 1:r for y = 1:c S(x,y).(F) = V end end ans = S...
View Full Document

This note was uploaded on 07/06/2009 for the course CS 1371 taught by Professor Stallworth during the Fall '08 term at Georgia Institute of Technology.

Ask a homework question - tutors are online