Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
search struct array

Subject: search struct array

From: amira ali

Date: 8 May, 2013 08:06:08

Message: 1 of 5

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

Subject: search struct array

From: amira ali

Date: 8 May, 2013 08:58:08

Message: 2 of 5

"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

Subject: search struct array

From: TideMan

Date: 8 May, 2013 09:10:57

Message: 3 of 5

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)

Subject: search struct array

From: amira ali

Date: 8 May, 2013 09:36:09

Message: 4 of 5

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

Subject: search struct array

From: amira ali

Date: 8 May, 2013 10:25:09

Message: 5 of 5

"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

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us