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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T16:25:12+00:00 2026-06-13T16:25:12+00:00

I am going to convert an array as [1 2 6 12 13 15

  • 0

I am going to convert an array as [1 2 6 12 13 15 20 8 30 31] to range [1 2 3 4 5 6 7 8 9 10] in EXCEL or in MATLAB. Is there any function to do it? Is there any suggestion to convert this type of arbitrary range to definite range?

  • 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-13T16:25:13+00:00Added an answer on June 13, 2026 at 4:25 pm

    Solution for MATLAB

    In MATLAB, unique can do the trick. For example:

    A = [1 1 1 1 4 4 5 3 3 6 6 6 6 8]
    [C, ia, ic] = unique(A);
    

    Now ic holds the values that you’re looking for:

    ic = 
        1    1    1    1    3    3    4    2    2    5    5    5    5    6
    

    Also, you can remap ic to a new order if you wish to do so. For instance, here’s a new order similar to the one you suggested:

    new_order = [1 3 2 4 6 5];
    ic_new = new_order(ic);
    

    which yields:

    ic_new = 
        1    1    1    1    2    2    4    3    3    6    6    6    6    5
    

    Hope that helps!

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

Sidebar

Related Questions

I want to convert vb this code <?php // Where the file is going
I am going to get results from database like this. array( [0] => array(
I read in a sequence of numbers with np.array(f.read().split(),dtype=np.float64) Then I convert this to
I am going to convert some file using php and send it as a
Going through happstack-lite tutorial : we build functions that have return type of ServerPart
going thru a tutorial on python lists,I tried to write a python function which
Going to http://www.example.com/node/NID/edit , where NID is any valid nid referring to a node
I am trying to convert a PIL image into an array using NumPy. I
I going to convert text file to XML. I use the following code. But
I'm trying to convert an array of products into a CSV file, but it

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.