Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
NCTM or The Math Forum.
|
|
|
Re: search struct array
Posted:
May 8, 2013 6:25 AM
|
|
"amira ali" wrote in message <kmd6a9$93l$1@newscl01ah.mathworks.com>... > TideMan <mulgor@gmail.com> wrote in message <70733f86-c302-49fe-960a-9764ceb7e581@googlegroups.com>... > > On Wednesday, May 8, 2013 8:58:08 PM UTC+12, amira ali wrote: > > > "amira ali" wrote in message <kmd11g$p6l$1@newscl01ah.mathworks.com>... > > > > > > > hello > > > > > > > i have struct array and i want to search in this stuct in some motion_pt and return points with all content(size,angle,responce,octave,class_id ) > > > > > > > example : > > > > > > > keypoints = 1x38 struct array with fields: > > > > > > > pt > > > > > > > size > > > > > > > angle > > > > > > > response > > > > > > > octave > > > > > > > class_id > > > > > > > > > > > > > > > > > > > > > > > > > > > > motion_pt (want to search about it in struc keypoints) > > > > > > > 96.2519 94.7565 79.3643 86.6593 84.2014 79.5626 > > > > > > > 54.0309 57.9461 58.3429 42.9641 55.9402 53.8894 > > > > > > > > > > > > plz anyone help me > > > > You're an impatient cove, aren't you? > > Your first post was only 50 min ago. > > > > Do this: > > [dum,indx)=min(abs([keypoints.pt]-96.2519)); > > keypoints(indx) > > sorry, but i have limited time and thanks for ur reply i need to make that for all motion_pt "so i use for loop"and put the filtered points in strucre array looks like stuct keypoints > > m=size(motion_pt,2) > for g=1:m > [dum,indx]=min(abs([keypoints.pt]-motion_pt(1,g))); > keypoints(indx) > > end thanks i found the soulation h = struct([]);
for g=1:m [dum,indx]=min(abs([keypoints.pt] -motion_pt(1,g))); h= [h, keypoints(indx)] ;%%struct of motion keypoints end
|
|
|
|