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 3947006
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T01:12:03+00:00 2026-05-20T01:12:03+00:00

I have N^2 matrixes. Each one is a 3×3 matrix. One way to concatenation

  • 0

I have N^2 matrixes.
Each one is a 3×3 matrix.
One way to concatenation them to a 3Nx3N matrix is to write
A(:,:,i)= # 3x3 matrix i=1:N^2

matrix

B=[A11 A12 ..A1N;A21 ...A2N;...]
But When N is large is a tedious work.
What do you offer?

  • 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-05-20T01:12:03+00:00Added an answer on May 20, 2026 at 1:12 am

    Here’s a really fast one-liner that only uses RESHAPE and PERMUTE:

    B = reshape(permute(reshape(A,3,3*N,N),[2 1 3]),3*N,3*N).';
    

    And a test:

    >> N=2;
    >> A = rand(3,3,N^2)
    A(:,:,1) =
        0.5909    0.6571    0.8082
        0.7118    0.6090    0.7183
        0.4694    0.9588    0.5582
    A(:,:,2) =
        0.1791    0.6844    0.6286
        0.4164    0.4140    0.5833
        0.1380    0.1099    0.8970
    A(:,:,3) =
        0.2232    0.2355    0.1214
        0.1782    0.6873    0.3394
        0.5645    0.4745    0.9763
    A(:,:,4) =
        0.5334    0.7559    0.9984
        0.8454    0.7618    0.1065
        0.0549    0.5029    0.3226
    
    >> B = reshape(permute(reshape(A,3,3*N,N),[2 1 3]),3*N,3*N).'
    B =
        0.5909    0.6571    0.8082    0.1791    0.6844    0.6286
        0.7118    0.6090    0.7183    0.4164    0.4140    0.5833
        0.4694    0.9588    0.5582    0.1380    0.1099    0.8970
        0.2232    0.2355    0.1214    0.5334    0.7559    0.9984
        0.1782    0.6873    0.3394    0.8454    0.7618    0.1065
        0.5645    0.4745    0.9763    0.0549    0.5029    0.3226
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The thing is I have to create a 2D matrix in php where each
I have a list prob with 50 elements. Each element is a 601x3 matrix
I have 100 models (matrices), where each matrix's size is 4X3. Each of the
I have both matrices containing only ones and each array has 500 rows and
I have a Matlab function that creates a cell array with matrixes inside. It
I have two matrices of different sizes. Let's just define matrix {a} as a(1:10)
I have 2 matrices and I need to multiply them and then print the
I have 2 matrices. The first one: [1,2,3] and the second one: [3,1,2 2,1,3
I have a 3-dimensial matrix W of size 160x170x18 and I want to compute
Suppose i have a matrix like this table = [ # grid: 4 by

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.