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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T09:23:29+00:00 2026-06-17T09:23:29+00:00

In GNU Octave, I can use the following code to get every 5th row

  • 0

In GNU Octave, I can use the following code to get every 5th row of X.

How do I get another matrix X_2 that consists of the rows that have not been extracted or left behind in X?

X = [1;2;3;4;5;6;7;8;9;10;11]
ix = ( 5 : 5 : size(X,1) )
X_1 = X( ix , : )

I want X_2 to have everything but 5 and 10. Is this possible?

  • 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-17T09:23:29+00:00Added an answer on June 17, 2026 at 9:23 am

    Gnu Octave, Get every nth row of a matrix/vector:

    X = [1;2;3;4;5;6;7;8;9;10;11]
    ix = ( 5 : 5 : size(X,1) )
    

    prints:

    ix =
        5   10
    

    Now, remove rows from the original matrix which will give you a list of the rows not extracted.

    Example, remove row 5 and 10 from X:

    X([5,10],:) = []
    

    Prints X with 5 and 10 missing:

    X =
    
        1
        2
        3
        4
        6
        7
        8
        9
       11
    

    So that proves concept. Use your ix variable to do it on the specified columns:

    X(ix,:) = []
    

    That will make X a list of the rows that have not been extracted. If you need to not disturb the original, make a copy of X and put it into another variable before you do this. Then assign X_2 = X;

    Source:

    Remove a column from a matrix in GNU Octave

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

Sidebar

Related Questions

In GNU Octave, How does matrix division work? Instead of doing 1./[1;1] I accidentally
I'm trying to write a function in GNU Octave that does bilinear interpolation on
I would like to calculate the following symbolic expression in GNU Octave: int(exp(ikx-|k|^n),k,-infinity,infinity) ,
In GNU Octave, I'm getting an error with this code. A = cell(10,1); A{5,1}
I want to get the date and time in GNU Octave and print it
in matlab/ GNU Octave( which i am actually using ), I use this method
In GNU Octave you can make a picture where different colors represent different values
GNU/Make manual §5.7 states the following: 5.7 Recursive Use of make Recursive use of
In GNU Octave version 3.4.3 I want to round a matrix to 2 units
I have the following gnu make script: for hdrfile in $(_PUBLIC_HEADERS) ; do \

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.