Prev: gaplotpareto
Next: Reading Ethernet port data in Matlab
From: happydude on 10 Nov 2009 16:05 if i have a struct to hold attendance information at a school and it looks like: course.schedule course.topic course.attendance there are 10 courses, schedule is a list of dates, ordered sequentially with no gaps and correspond to a similarly ordered attendance numbers how would i find the total attendance for each date in the union of the entire school schedule? using no for loops?
From: jrenfree on 10 Nov 2009 19:03 On Nov 10, 1:05 pm, "happydude " <anonymou...(a)hotmail.com> wrote: > if i have a struct to hold attendance information at a school > > and it looks like: > > course.schedule > course.topic > course.attendance > > there are 10 courses, > schedule is a list of dates, ordered sequentially with no gaps and correspond to a similarly ordered attendance numbers > > how would i find the total attendance for each date in the union of the entire school schedule? using no for loops? Hmmm....I don't think this is the easiest way, but it works for me. temp = [course.attendance]; temp2 = reshape(temp, length(course(1).attendance), length(course)); sum(temp2, 2)
|
Pages: 1 Prev: gaplotpareto Next: Reading Ethernet port data in Matlab |