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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T01:42:08+00:00 2026-06-12T01:42:08+00:00

I have following data matrix, I want to iterate over this matrix and look

  • 0

I have following data matrix, I want to iterate over this matrix and look at a value in the last column based on a given row and add that row – last element of that row to a new matrix.

5.1000    3.3000    1.7000    0.5000    1.0000
6.8000    3.2000    5.9000    2.3000    3.0000
5.0000    2.3000    3.3000    1.0000    2.0000
7.4000    2.8000    6.1000    1.9000    3.0000
6.5000    3.2000    5.1000    2.0000    3.0000
4.8000    3.4000    1.9000    0.2000    1.0000
4.9000    3.0000    1.4000    0.2000    1.0000
5.1000    3.8000    1.5000    0.3000    1.0000
5.1000    3.4000    1.5000    0.2000    1.0000
5.5000    2.6000    4.4000    1.2000    2.0000

This is the code that I have

 M1 = [];
 M2 = [];
 M3 = [];
    for i=1:length(currentCell)
        if currentCell(1,5) == 1.00
            m3Data = currentCell(1:1,1:4);
            %how can I add m3Data to M1
        end
    end
  • 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-12T01:42:09+00:00Added an answer on June 12, 2026 at 1:42 am

    Let your original matrix be M, then this

    M1 = M(find(M(:,5)==1),1:4)
    

    puts all the rows ending with a 1 into M1, excluding the final column. Is that what you want ?

    You could do it with a for loop if you want, but I don’t see any need.

    • 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 data (with row names and column names). I would
I have following data in my table. alt text http://img26.imageshack.us/img26/3746/productfield.png I want to extract
I have a data file look like the following 3 1.0 1.4 1.7 2
I currently have data that is in the following format (note, this is 1
I have the following matrix of data, which I am reading into SAS: 1
I have data in a matrix in the following way: label 1 2 3
I have the following data in my dataset Type | Code | Value C1
I have following data frames > head(elo) date elo 1 1921-12-18 1597 2 1922-05-14
I have following data structure (simplified): A giant list of the class TestClass public
I have following data to save in database using php my data is :

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.