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:
different row size submatrices

Subject: different row size submatrices

From: Nora

Date: 25 Aug, 2010 22:41:26

Message: 1 of 3

Hi all,
I have a matrix with "n rows and 2 columns" (matrix "A"). I want to divide this matrix to different sizes (n rows, 2 columns) submatrices. The row length of submatrices are irregular (B=[1 to 10; 11 to 30; and go on]).
How can I create these submatrices with indexing (A1, A2..).Can I do that?
 Could you give me any suggestion?

Thanks in advances

Subject: different row size submatrices

From: TideMan

Date: 26 Aug, 2010 00:57:14

Message: 2 of 3

On Aug 26, 10:41 am, "Nora " <nursu...@yahoo.com> wrote:
> Hi all,
> I have a matrix with "n rows and 2 columns" (matrix "A"). I want to divide this matrix to different sizes (n rows, 2 columns) submatrices. The row length of submatrices are irregular (B=[1 to 10; 11 to 30; and go on]).
> How can I create these submatrices with indexing (A1, A2..).Can I do that?  
>  Could you give me any suggestion?
>
> Thanks in advances

B=A(1:10,:);
C=A(11:30,:);
D=A(31:end,:);

Subject: different row size submatrices

From: Steven_Lord

Date: 26 Aug, 2010 03:38:31

Message: 3 of 3



"Nora " <nursutun@yahoo.com> wrote in message
news:i5466m$sai$1@fred.mathworks.com...
> Hi all,
> I have a matrix with "n rows and 2 columns" (matrix "A"). I want to divide
> this matrix to different sizes (n rows, 2 columns) submatrices. The row
> length of submatrices are irregular (B=[1 to 10; 11 to 30; and go on]).
> How can I create these submatrices with indexing (A1, A2..).Can I do that?
> Could you give me any suggestion?

Yes. Don't do this. See question 4.6 for a description as to why this is a
Bad Idea and some alternatives you should use if you really need to do
something like this.

--
Steve Lord
slord@mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
To contact Technical Support use the Contact Us link on
http://www.mathworks.com

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