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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T04:14:39+00:00 2026-06-06T04:14:39+00:00

Hi I have a 3 dimensional matrix that I am trying to convert the

  • 0

Hi I have a 3 dimensional matrix that I am trying to convert the rows to columns and then stack all the columns to generate a vector that will have the three dimensions.

therefore, row 1 becomes column 1, row 2 becomes column 2 etc. And then, column 2 goes under column 1, column 3 under column 1 and 2. I also need to keep the dimensions the same

PV_power_output(:,:,K) below is a 365 x 24 x 27 matrix, which should become a 8760×1 vector following the positioning sequence mentioned above

I am struggling with the coding of this

So far I have

PV_power_output(:,:,K) = real((Vmpp_(:,:,K).*Impp_(:,:,K))*inverter_efficiency)/1000; 

 permdims = 1 : ndims(PV_power_output); 
out = reshape(permute(PV_power_output, permdims),8760,1,[]);

However, on checking the elements in different positions, the above is incorrect and so any help would be great!

  • 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-06T04:14:44+00:00Added an answer on June 6, 2026 at 4:14 am

    Perhaps your permute is wrong, because as it stands it’s not doing anything:

    permute(PV_power_output, 1:3) == PV_power_output
    

    maybe you need:

    permute(PV_power_output, [2 1 3])
    

    I general I often find reshape difficult to follow (especially when you go back to the code three weeks later) so if performance is not critical then you could consider using a loop here instead for your 3d matrix.

    You might think about a cell array instead of 3d matrix, and then your reshape is much more straight forward:

    PV_power_output{K} = real((Vmpp_(:,:,K).*Impp_(:,:,K))*inverter_efficiency)/1000;
    
    vector = reshape(PV_power_output{K},8760,1);
    

    Update:

    Perhaps try reshaping to 2D:

    out = reshape(permute(PV_power_output, [2 1 3]), 8760,27);
    

    And then you can access the Kth column vector as:

    vector_K = out(:,K)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a quadratic matrix(two-dimensional dynamic array of pointers) and need to change rows/columns
I have a class that contains a few multi-dimensional arrays. I am trying to
I am trying to encode a matrix that i have (after calculating frame differences)
I have an multi-dimensional array that I want to send to a PHP script
I have matrix with 3 dimension (n*m*k). I am trying to fined the maximum
I have a sparse matrix that is not symmetric I.E. the sparsity is somewhat
I have a two-dimensional array: function getMatrix(size) { var matrix = []; for (var
I have two dimensional matrix which stores values between 0 to 1. I want
I have a 2-dimensional matrix of cells. Usually only invisible algorithms work with these
I have a high dimensional Gaussian with mean M and covariance matrix V. I

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.