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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T05:17:28+00:00 2026-06-14T05:17:28+00:00

I have a struct called poseSets and it contains two things: Pose Time So

  • 0

I have a struct called poseSets and it contains two things:

  1. Pose
  2. Time

So what I want to do is to get the poses (Pose is a 4×4 matrix) in to one big long (4xN_Poses) x 4 matrix.

So lets imagine that i have a list of structs that is 10 long. I can get almost my list by doing this:

[structList.Pose]

But this gives me a (4xN) x 4 matrix ie:

1 2 3 4 | 1 2 3 4 | 1 2 3 4 | ...
5 6 7 8 | 5 6 7 8 | 5 6 7 8 | ...
3 5 6 8 | 3 5 6 8 | 3 5 6 8 | ...
0 0 0 1 | 0 0 0 1 | 0 0 0 1 | ...

But what i really want is this:

1 2 3 4
5 6 7 8
3 5 6 8
0 0 0 1
_______ 
1 2 3 4
5 6 7 8
3 5 6 8
0 0 0 1
_______ 
1 2 3 4
5 6 7 8
3 5 6 8
0 0 0 1
_______ 
: : : :

Now i cant transpose it because each of the matrices would be individually transposed and would be the wrong way.

Now you can solve this with a for loop:

poseList = [];

for i = 1:length(PoseSets);
    poseList = [poseList; PoseSets(i).Pose];
end

Note: poseList contains what i want.

But I personally believe that matlab is magic and you should be able to write what you want in english and matlab will deliver. Does anyone know a one liner or a better way to do this?

  • 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-14T05:17:29+00:00Added an answer on June 14, 2026 at 5:17 am

    Yes, I also find this quite annoying…some things in Matlab do not seem consistent regarding row-majorness or column-majorness. This is one example where things are concatenated colum-wise (=row-major), while the vast majority of algorithms are column-major. linspace or generic ranges (e.g., x = 0:5:100) are another prime example of row-major matrix generation, while x(:) is then again column-major… ¯\(°_°)/¯

    Anyway, the easiest way to resolve is to force column-major concatenation:

    cat(1, structList.Pose)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a C struct that basically contains two 2D char arrays called List.
Suppose I have a struct called foo_boolean that contains some boolean values: struct foo_boolean
I have a struct which contains a member called char *text. After I've created
Let's say I have a struct called Thing. If I want to have an
Let's say I have a struct called Woah . Woah has one field to
I have two classes: MazeClass and CreatureClass, that use a struct called "coordinates," how
I have a struct called Point. Point is pretty simple: struct Point { Row
I have a struct called coordinate which is contained in a list in another
I am trying to model a network using C++. I have a struct called
I have a struct array called AnalysisResults , that may contain any MATLAB datatypes,

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.