Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8049389
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T06:46:22+00:00 2026-06-05T06:46:22+00:00

I am having trouble with the following task: Suppose a 3×6 matrix: A =

  • 0

I am having trouble with the following task:
Suppose a 3×6 matrix:

A =

0.2787    0.2948    0.4635    0.8388    0.0627    0.0435
0.6917    0.1185    0.3660    0.1867    0.2383    0.7577
0.6179    0.7425    0.0448    0.4009    0.9377    0.4821

What I would like to do is to divide the matrix into blocks, like this:

A =

0.2787    0.2948  |  0.4635    0.8388  |  0.0627    0.0435
0.6917    0.1185  |  0.3660    0.1867  |  0.2383    0.7577
0.6179    0.7425  |  0.0448    0.4009  |  0.9377    0.4821

and vertically concatenate these blocks to get the final result:

0.2787    0.2948 
0.6917    0.1185  
0.6179    0.7425  
0.4635    0.8388
0.3660    0.1867
0.0448    0.4009
0.0627    0.0435
0.2383    0.7577
0.9377    0.4821

I think if I can get help with this, then I can perhaps
do it for arbitrary matrices A. I can solve the above
problem using for-loops, but I am looking for a vectorised solution.

Thanks in advance!
N.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T06:46:24+00:00Added an answer on June 5, 2026 at 6:46 am

    Consider the following:

    A = rand(3,6);
    blkSz = 2;
    
    C = mat2cell(A, size(A,1), blkSz*ones(1,size(A,2)/blkSz));
    C = cat(1,C{:})
    

    This assumes that size(A,2) is evenly divisible by blkSz

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having trouble following this guide to extract my interfaces and entities from my
I am having trouble following the AngelScript manual on the proper way to register
Having trouble with the following segment of code. I'm getting a parameter count mismatch.
I am having trouble with the following bit of code. //Send Creation email ListServDAO.sendCreateEmail(orgId,
I am having trouble with the following piece of code. Before I paste it,
I am having trouble with the following MYSQL query and are hoping that there
I am having trouble with the following SQL statement. I have had this issue
I am having trouble understanding the following article: http://www.ibm.com/developerworks/java/library/j-jtp01255.html Under, Generics are not covariant
I am having trouble implementing the following behaviour in a dropdown menu with jQuery.
Whilst doing exam revision I am having trouble answering the following question from the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.