Got Questions? Get Answers.
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:
select remaining rows of my matrix

Subject: select remaining rows of my matrix

From: Patrick Diviacco

Date: 15 Sep, 2009 14:17:20

Message: 1 of 3

hi,

I've selected the first rows of matrix A

TrainingSet1 = A(1:225,:);

Is there any method to select the remaining columns instead of writing ?

TestSet1 = A(226:300,:);

thanks

Subject: select remaining rows of my matrix

From: Jos

Date: 15 Sep, 2009 14:38:01

Message: 2 of 3

"Patrick Diviacco" <patrick.diviacco@gmail.com> wrote in message <h8o7lg$rga$1@fred.mathworks.com>...
> hi,
>
> I've selected the first rows of matrix A
>
> TrainingSet1 = A(1:225,:);
>
> Is there any method to select the remaining columns instead of writing ?
>
> TestSet1 = A(226:300,:);
>
> thanks

What is wrong with it? It is very clear, concise and fast!

Jos

Subject: select remaining rows of my matrix

From: dpb

Date: 15 Sep, 2009 14:42:10

Message: 3 of 3

Jos wrote:
> "Patrick Diviacco" <patrick.diviacco@gmail.com> wrote in message <h8o7lg$rga$1@fred.mathworks.com>...
>> hi,
>>
>> I've selected the first rows of matrix A
>>
>> TrainingSet1 = A(1:225,:);
>>
>> Is there any method to select the remaining columns instead of writing ?
>>
>> TestSet1 = A(226:300,:);
>>
>> thanks
>
> What is wrong with it? It is very clear, concise and fast!

Agreed.

But, for a little more generality, you could name the first column
boundary and use that plus END in the latter...

TSbound = 225;
TrSet = a(1:TSbound,:);
TstSet = a(Tsbound+1:end,:);

doc end

--

Tags for 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