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:
output using index

Subject: output using index

From: audley james

Date: 18 Jan, 2011 20:42:05

Message: 1 of 2

hello all,

I have an index matrix :

idx =
           1
           3

and a matrix X

X =
          10 20 30
          40 50 60
          70 80 90
          99 88 77

Using 'idx', how can I get the corresponding rows in X as follows:
 
result =
              10 20 30
              70 80 90

thanks,
audley

Subject: output using index

From: Rick Rosson

Date: 18 Jan, 2011 20:45:09

Message: 2 of 2


X(idx,:)




"audley james" <audleyer@gmail.com> wrote in message
news:ih4tus$kjo$1@fred.mathworks.com...
> hello all,
>
> I have an index matrix :
>
> idx = 1
> 3
>
> and a matrix X
>
> X =
> 10 20 30
> 40 50 60
> 70 80 90
> 99 88 77
>
> Using 'idx', how can I get the corresponding rows in X as follows:
>
> result = 10 20 30
> 70 80 90
>
> thanks,
> audley

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