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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T17:22:13+00:00 2026-06-08T17:22:13+00:00

For example [2 , 5] dominates [3 , 8] cause (2 < 3) and

  • 0

For example [2 , 5] dominates [3 , 8] cause (2 < 3) and (5 < 8)

but [2 , 5] does not dominates [3 , 1] cause though (2 < 3) but (5 > 1) so these two vectors are non dominated

now for example assume that I have a matrix like this :

a =[ 1 8;
    2 6;
    3 5;
    4 6];

here the first three are non dominated but the last one is dominated by (3,5), I need a code which can omit it and give me this output:

ans =

    [ 1 8;
    2 6;
    3 5]

note that there may be lots of non dominated elements in a Nx2 matrix

  • 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-08T17:22:15+00:00Added an answer on June 8, 2026 at 5:22 pm
    1. Compare one row with other rows using bsxfun
    2. Do this for every row using arrayfun (or a loop if you prefer that) and transform the output back to a matrix with cell2mat
    3. use any and all to check which rows are dominated
    4. remove these rows

    code:

    a=[1 8;2 6;3 5;4 6];
    dominated_idxs = any(cell2mat(arrayfun(@(ii) all(bsxfun(@(x,y) x>y,a,a(ii,:)),2),1:size(a,1),'uni',false)),2);
    
    a(dominated_idxs,:) = [];
    

    edit

    If you want to use >= instead of > comparison, each row will dominate itself and will be removed, so you’ll end up with an empty matrix. Filter these false-positives out by adjusting the code as follows:

    a=[1 8;2 6;3 5;4 6];
    N = size(a,1);
    
    compare_matrix = cell2mat(arrayfun(@(ii) all(bsxfun(@(x,y) x>=y,a,a(ii,:)),2),1:N,'uni',false));
    compare_matrix(1:N+1:N^2)=false; % set diagonal to false
    dominated_idxs = any(compare_matrix,2);
    
    a(dominated_idxs ,:) = [];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Example: var sessions = require('sessions'); function load_session(req) { sessions.load(sid); } Now that the session
Example Div: <div class=container> <div class=select1></div> <div class=select2></div> <div class=select3></div> </div> Now I want
Example: an Employee table with an optional DateOfBirth field can be normalized into two
Example: the user fills in everything but the product name. I need to search
Example: puts <<BLOCK ... BLOCK with BLOCK being any other identifier that doesn't clash
// example-1: GetStringUTFChars() public class Prompt { // native method that prints a prompt
Example Outlook: its only one process but can have multiple windows (user can double
Example RSS feed link: http://twitter.com/statuses/user_timeline/twitter.rss Does anyone know if Twitter limits calls to a
Example if I make a script that loads images only when user scrolls page
Example: print max(chain_length(i) for i in xrange(1,10001)) This returns the maximum/biggest chain_length (an arbitrary

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.