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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T03:12:09+00:00 2026-05-27T03:12:09+00:00

I have a problem with removing surplus rows in the end of the matrix.

  • 0

I have a problem with removing surplus rows in the end of the matrix. In general, I need to remove rows that contain a specific elements in a specific column, without using a loop. It seems easy but I still keep on getting some weird outcomes.

For simple example, let’s have a 10×10 matrix A:

A=[1:10; 901:910; 201:210; 301:310; 701:710; 401:410; 601:610; 501:510; 801:810; 101:110];

And I want to remove (for better illustration just replace with ones) that rows from fourth to the last, whose third columns contain value higher than 600. Result should look like that:

|  1     2     3     4     5     6     7     8     9    10|
|901   902   903   904   905   906   907   908   909   910|
|201   202   203   204   205   206   207   208   209   210|
|301   302   303   304   305   306   307   308   309   310|
|  1     1     1     1     1     1     1     1     1     1|
|401   402   403   404   405   406   407   408   409   410|
|  1     1     1     1     1     1     1     1     1     1|
|501   502   503   504   505   506   507   508   509   510|
|  1     1     1     1     1     1     1     1     1     1|
|101   102   103   104   105   106   107   108   109   110|

My idea looks like that:

A(A(4:end,3)>600,:)=[1];

But the outcome is some nonsense matrix.

Thanks for your help!

  • 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-27T03:12:10+00:00Added an answer on May 27, 2026 at 3:12 am
     A([false(3,1);A(4:end,3)>600],:)=1;
    

    and as @yoda said, to remove the rows do:

     A([false(3,1);A(4:end,3)>600],:)=[];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a problem removing breakpoints that are set when I attach to a
I have problem removing rows from a table according to the checkbox. Below is
I have problem in some JavaScript that I am writing where the Switch statement
I have problem when I try insert some data to Informix TEXT column via
I have problem with fancybox. I want to write a function that will run
I have a problem removing the parent entity from the database. The code looks
I have a problem that can be simplified as follows: I have a particular
i have a problem in removing the old markers without removing the central point
I have problem with a counting column in my view. SELECT ColumnC, ColumnA %
Brainstorming needed . I have a problem with Javascript libraries (jQuery, ExtJS etc.) that

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.