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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T21:32:15+00:00 2026-06-02T21:32:15+00:00

Okay, suppose I have a 3D matrix A and another 3D matrix Inds. What

  • 0

Okay, suppose I have a 3D matrix A and another 3D matrix Inds. What I would like to do is, for each stack A(i,j,:), permute that stack according to the indices given in Inds(i,j,:). Thus, if A(i,j,:) is [1.5 2.5 3.5] and Inds(i,j,:) is [3 2 1] then A(i,j,:) becomes [3.5 2.5 1.5].

Yes, I know A(i,j,:) is not a vector in Octave. Consider it shorthand for permute(A, [1 3 2])(i,:,j).

This should be simple, but for whatever reason I can’t seem to find the function to do it.

  • 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-02T21:32:16+00:00Added an answer on June 2, 2026 at 9:32 pm

    It matlab its quite simple:

    A(i,j,:) = A(i,j,Inds(i,j,:));
    

    In Matlab you can rearrange any vector using a vector of indices:

    A = [10 20 30 40 50 60];
    B = [6 5 4 1 2 3];
    A = A(B);
    

    A is now [60 50 40 10 20 30]

    If A is MxNxP, when you use A(i,j,:) notation you are essentially dealing with a Px1 vector that you can manipulate at will.

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

Sidebar

Related Questions

Okay I have a large CRUD app that uses tabs with Forms embedded in
Okay, Ive got a cog (toothed gear) that I have drawn in opengl. I
Okay, suppose we have a line of text: [s]tackoverflow rocks where the brackets show
Suppose I have pointer of type ABC* and another pointer of type XYZ* and
Okay, suppose I have a bunch of variables, one of them declared volatile: int
Suppose that I have a date Jan 31 2011 and I want to add
I have a module that uses std::string as part of its interface. I would
suppose we have strings like adjkadahsdjashd##kjhkhkjhkjhs . and I want to cut them to
Suppose I have a query like this: SELECT s.staffID as staffID, CONCAT_WS(, , lname,
Okay, here we go... I have a page XYZ with a button that's supposed

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.