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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T22:05:55+00:00 2026-05-23T22:05:55+00:00

If I have an array that contains the values [6712, 7023, 7510, 7509, 6718,

  • 0

If I have an array that contains the values [6712, 7023, 7510, 7509, 6718, 7514, 7509, 6247] and I want 4 groups of similar numbers so that the output is 4 matrices:

[6247]
[6712, 6718]
[7023]
[7510, 7509, 7514, 7509]

What would be the best way to accomplish this?

  • 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-23T22:05:55+00:00Added an answer on May 23, 2026 at 10:05 pm

    I believe the term you are looking for is clustering. For example, we can apply the Kmeans algorithm to group the data into 4 clusters:

    X = [6712, 7023, 7510, 7509, 6718, 7514, 7509, 6247];
    [IDX,C] = kmeans(X, 4, 'EmptyAction','singleton');
    G = cell(4,1);
    for i=1:4
        G{i} = X(IDX==i);
    end 
    

    This is one of the result I get:

    >> G{:}
    ans =
            7510        7509        7514        7509
    ans =
            7023
    ans =
            6247
    ans =
            6712        6718
    

    Usually this works best with more points (also works for multidimensional data)

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

Sidebar

Related Questions

I have a C array fftArray[64] that contains values that I want averaged and
I have an array that contains the RGB colour values for each pixel in
Lets say I have an array numbers that contains the following values: int numbers
I have an Array that contains some elements multiple times. Now I want to
I have an array that contains values that I'm working on (in a specific
I have an array result that contains values from 0-255. I originally declared it
I have a ArrayList that contains values in the form [ann,john]. I want to
I want to create an array in numpy that contains the values of a
I have an array ( nodes[][] ) that contains values of effective distances that
I have an array in python that contains a set of values, some of

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.