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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T15:37:30+00:00 2026-06-18T15:37:30+00:00

In Matlab, how can I remove spesific rows from a matrix I require? If

  • 0

In Matlab, how can I remove spesific rows from a matrix I require? If for example I would like to remove all rows from a matrix which contain a spesific value (like 0 or NaN)?

  • 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-18T15:37:30+00:00Added an answer on June 18, 2026 at 3:37 pm

    Let’s say you have A

    A = [1 2 3;4 5 0; 7 8 9; 10 NaN 12]
    
    A =
    
         1     2     3
         4     5     0
         7     8     9
        10   NaN    12
    

    Then, you can choose the rows as follows:

    any(isnan(A'))
    
    ans =
    
         0     0     0     1
    

    To delete those NaN-containing rows, you can do:

    A(any(isnan(A')),:) = []
    
    A =
    
         1     2     3
         4     5     0
         7     8     9
    

    You can choose 0-containing rows by any(A' == 0). If you want all elements to be 0s or NaNs, then you can use all instead of any.

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

Sidebar

Related Questions

I would like to know how I can record a video in MATLAB with
How can I create tabs in matlab gui? I did something like this a
How can I add a vector to a matrix in Matlab, in a manner
How to remove noise from ecg signal in ecg.wav format using filters in matlab
I'm making some figures in Matlab, many of which I'd like to print at
I can reference Matlab code from a x86 based project, but not from an
I have the following code in matlab and trying to remove an element from
Matlab is displaying a black border around a plot and I would like to
My matlab can't recognise the unix('who'); it returns as the 'who' is not an
Can I install matlab on beagleboard xm (running ubuntu 12.04)? If I can't how

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.