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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T04:59:34+00:00 2026-05-29T04:59:34+00:00

I have a matrix X e.g = [a b; c d; e f] .

  • 0

I have a matrix X e.g = [a b; c d; e f].

I need to create another matrix listing the index positions and values of the matrix.

e.g. The output is E = [ 1 1 a ; 1 2 b ; 2 1 c ; 2 2 d ; 3 1 e ; 3 2 f ]

I have been trying to use a double for loop but even if it did work, that sounds like a bad idea.

So can anyone has a better idea to perform above task?

  • 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-29T04:59:35+00:00Added an answer on May 29, 2026 at 4:59 am

    Here is the dumbest thing I could think of (Assuming that a,b,c,d,e,f are all scalars)

    x = [1 2;3 4;5 6];
    [i,j]=ind2sub(size(transpose(x)), 1:numel(x));
    [j(:) i(:) reshape(transpose(x),[],1)]
    

    However, I have a feeling that there might be an answer that is more elegant.

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

Sidebar

Related Questions

I have a need to basically create a matrix of values in my Silverlight
I'm trying to create a matrix data structure in C. I have a struct
I am trying to use webkit's support for CSS3 transform: matrix3d(<matrix>) to create a
I have a matrix in MATLAB and I need to find the 99% value
I have a feature matrix implemented with Silverlight's Grid where users need to select
I have a need for a sparse matrix in up to 4 dimensions in
I have a 30000x14000 sparse matrix in MATLAB (version 7), which I need to
I have a program that uses JAMA and need to test is a matrix
I am trying to create a matrix to look like this: [1 x x^2
I have an issue right now with a program im trying to create. 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.