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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T14:05:29+00:00 2026-06-04T14:05:29+00:00

I have a one-column array that I would like to sort in descending order.

  • 0

I have a one-column array that I would like to sort in descending order. The array has values ranging from 0 to approximately 10^14. When I sort the array with

sorted = sort(A,'descend')

and try to look at the ten largest values, I find that

sorted(1:10)

gives me

1.0e+14 *

5.1093

0.0000

0.0000

0.0000

etc… — Displaying these first few, large entries tells me that there’s only one non-zero element, which isn’t true.
However, if I skip the first couple of entries, which are far greater than the rest of the array elements, I get

sorted(8:10) =

2.9754

2.4182

2.0799

Why does displaying these first few large array elements cause all others to be displayed as zero?

  • 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-04T14:05:30+00:00Added an answer on June 4, 2026 at 2:05 pm

    The first number in your list is a scale factor that multiplies the entire array that follows. Because of the difference in magnitude of the elements, you will need to play with the format settings. Try

        format long
    

    or

        format long e
    

    to see a better representation

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

Sidebar

Related Questions

I have a dataframe with one column that I would like to split into
I would like to have one column in QTableWidget NOT editable. In forums I
I have a 2D-array that I want to sort based on the second column.
I have a table with one column and four rows. Each tr has a
I have some simple XML which I would like to parse into an array
Lets say you have various objects of arbitrary type that you would like to
I have two models that I would like to present in a single Yii
I have one table which display data as from Dynamic Content in 1 column.
I would like to archive a student by moving the record from one table
I have a column chart in Highcharts that looks roughly like this: | |

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.