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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T14:54:14+00:00 2026-06-13T14:54:14+00:00

I have a matrix with one column like this: NNN NNN NNN AAA AAA

  • 0

I have a matrix with one column like this:

NNN

NNN

NNN

AAA

AAA

CCC

CCC

DDD

DDD

DDD

I would like to remove all the lines in which I don’t have 3 repetitions. This would result in removing lines 4,5,6,7 (and the result would be only the matrix with the remaining:

NNN

NNN

NNN

DDD

DDD

DDD

(PS: Those are strings, not numbers).

Is there an inteligent way to do that using matlab? I mean, using the functions and etc? Because I solved the problem with a for, but I think it is not the best way to do it and that it must have another way.

Thanks for the help in advance! 🙂

  • 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-13T14:54:16+00:00Added an answer on June 13, 2026 at 2:54 pm

    This should do it:

    t=tabulate(x) % count how much each element appears
    valid=t(cell2mat(t(:,2))>=3,1) % find strings that appear at least 3 times 
    result=x(ismember(x,valid)) % select only these strings
    

    I assume here that x is a cell matrix with one column of strings. If x has other columns it is an easy fix.

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

Sidebar

Related Questions

I have a matrix of one column and 6 rows. I would like to
In R: I have a matrix with one column classified by 8 types: a,
I have one column matrix with n rows. I want difference between row 2
I have made one function in which I am passing a matrix and returning
I have matrix (a) with (1:10),<10 x 1> double. I would like to copy
Suppose i have a matrix like this table = [ # grid: 4 by
I have created a 2D matrix like this: 45 67 Row Fine 25 22
Let's say I have a file like this (pretend it were a matrix): abcde
I have two matrix extracted from different csv files, One is like > matrix1[1:6,]
I have implemented one matrix multiplication with boost::numeric::ublas::matrix (see my full, working boost code

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.