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

The Archive Base Latest Questions

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

I have a time series for which I have a function that returns the

  • 0

I have a time series for which I have a function that returns the local maxima and minima in a matrix that is sorted in descending order by the y coordinate. For example, running it on the following series:

[1 7 3 7 10 12 6 4 6]

would return:

{ {6 , 12}, {2, 7}, {9, 6} }

As the local maxima. How can I sort this matrix so that it is sorted by the index in ascending? I want:

{{2, 7}, {6, 12}, {9, 6}}

EDIT:
I’ve actually modified my function to just return values in index-sorted order. But I would still like to know the best way of doing this (sorting a matrix by one column value).

  • 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:02:06+00:00Added an answer on June 7, 2026 at 1:02 am

    You want sortrows(). Note, however, that it works on standard arrays, not the cell arrays that you’ve shown in your question. For example:

    >> m = [ 6 12; 2 7; 9 6 ];
    >> sortrows(m)
    
    ans =
    
         2     7
         6    12
         9     6
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a time series like this which consists of past 4 months (Feb,
I have 100 text files which contains time series starting and ending at different
I have a program which simulates a physical system that changes over time. I
I have a (C#) genetic program that uses financial time-series data and it's currently
I have time series data that I am currently storing in a dictionary where
I have a data frame in which each column is a time series of
I have a xts object (stock price time series) that is comprised of intraday
I have hundreds of thousands of points of time series data that I want
I have a large number of time series variables (stock prices) of which I
I have a vector containing simple time series data (extracted from a deSolve matrix),

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.