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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T01:18:07+00:00 2026-06-07T01:18:07+00:00

I have data from a measurement. It is stored in the format x y

  • 0

I have data from a measurement. It is stored in the format
x y value

  x         y      value

   64        4     2743
   64        8     3531
   64       16     4543
   64       32     5222
   64       64     5730
  128        4     2778
  128        8     3500
  128       16     4657
  etc

How can I rearrange this into a matrix of format

    y= 4    8    16   32   64
x=
64    2743 3531 4543 5222 5730
128   2778 3500 4657 …    …  
256   …    …    …    …    …
512   …    …    …    …    …

in octave?

  • 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-07T01:18:08+00:00Added an answer on June 7, 2026 at 1:18 am

    Here I am assuming you have a measurement for every combination of values of x and y, else we cannot create a matrix. Also, the sequence of x and y values should repeat just like your example.

    % raw data is in a matrix D
    % Unique will tell us all the values in the order in which they appear
    x = unique(D(:, 1));
    y = unique(D(:, 2));
    % Reshape can create a matrix from a vector in column-major order
    d = reshape(D(:, 3), length(y), length(x))'; % note transpose
    
    newData = [x d];
    

    Output:

    octave> D
    D =
    
         64      4   2743
         64      8   3531
         64     16   4543
         64     32   5222
         64     64   5730
        128      4   2778
        128      8   3500
        128     16   4657
        128     32   4512
        128     64   7854
    octave> y'
    ans =
    
        4    8   16   32   64
    
    octave> newData
    newData =
    
         64   2743   3531   4543   5222   5730
        128   2778   3500   4657   4512   7854
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can I store negative value in mysql decimal? I have data from DMS
We have a data collection system that collects measurements from environmental sensors that measure
I have data from travel diaries which has been read in from a csv
I have data from two different sources that I need to combine. Some data
I have data from *.obj file. I know how draw with GL_TRIANGLES . How
I have data from tests with two lists of parts, called in and out.
I need to get some data from a column. For example I have data
I have data coming from an external system (in CSV form). The data contains
i have data below from streaming: 'ID|20120206|080500|0000001|0|1|record1|END' 'ID|20120206|080500|0000002|0|1|record2|END' 'ID|20120206|080500|0000003|0|1|record3|END' and i want to process
I have some data from log files and would like to group entries 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.