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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T07:08:49+00:00 2026-06-03T07:08:49+00:00

I have some problem in matlab since I was new in this programming language.

  • 0

I have some problem in matlab since I was new in this programming language. Okay here it is :

I have Matrix and I have sorted it ascending, for example :

1
1
1
3
4
4
4
5
6
6
7
7
9
9
9
9
9

It’s only 1 column matrix. I want to divide the matrix into two groups with some scalar value. Is I choose 5 as the scalar so my matrix will be divide into two groups higher than 5 and lower than 5 :

Expected result :

Lower Matrix :

1
1
1
3
4
4
4
5

Higher Matrix :

6
6
7
7
9
9
9
9
9

I have tried using max and min command but this command keep the matrix size and replace all lower number than scalar (5) into 5. Its a problem since for the next step I want to sum each lower and higher matrix.

Could you suggest me some trick?
Many thanks

  • 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-03T07:08:51+00:00Added an answer on June 3, 2026 at 7:08 am

    You can use logical addressing to do this:

    LowValuesMatrix = Matrix(Matrix <= 5);
    HighValuesMatrix = Matrix(Matrix > 5);
    
    LowValuesMatrix =
     1
     1
     1
     3
     4
     4
     4
     5
    
    HighValuesMatrix =
     6
     6
     7
     7
     9
     9
     9
     9
     9
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need some help in this problem I have this matrix in MATLAB: A
I have some problem to order an array by a field of this, here
I have some problem with my .htaccess file. Here I am adding my problem.
I have a problem in my MATLAB code. Let me first give you some
Hey guys, I have a very simple problem in MATLAB: I have some strings
I have previous experience with MATLAB, but the problem that I face is some
I have a problem that is driving me nuts. Matlab sees only some of
I have a problem understanding some code fragment from Matlab Signal processing Toolbox fir2()
I'm quite new to MATLAB programming and I ran into some trouble: I want
I have some problem with my IIS today. I try to load a .img

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.