The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: extract the rows except the specific index
Replies: 3   Last Post: Dec 28, 2012 4:19 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]

Posts: 9,850
Registered: 6/7/07
Re: extract the rows except the specific index
Posted: Dec 28, 2012 4:06 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

On 12/28/2012 12:47 PM, dpb wrote:

> b=1; t=6; n=3;
> idx=randperm(t,n); % doc randperm
> train = A(idx,:);
> test=A(setdiff([t:b],idx),:); % doc setdiff and friends...


test=A(setdiff([1:t],idx),:); % doc setdiff and friends...

Can't really generalize randperm just by t:b; it only takes the one
argument so if that's needed (didn't look like would be from original
post but just for the record) it'll need handling somewhat differently.


Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.