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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T04:53:16+00:00 2026-06-12T04:53:16+00:00

I manage to do a 10 fold and store the data into a cell

  • 0

I manage to do a 10 fold and store the data into a cell and my cell has the following structure:

[135x5 double]    [15x5 double]
[135x5 double]    [15x5 double]
[135x5 double]    [15x5 double]
[135x5 double]    [15x5 double]
[135x5 double]    [15x5 double]
[135x5 double]    [15x5 double]
[135x5 double]    [15x5 double]
[135x5 double]    [15x5 double]
[135x5 double]    [15x5 double]
[135x5 double]    [15x5 double]

here is a small snapshot of what data is in this cell, let say we assign this cell in to a variable cell here is the cell{1,1} – This is actually Iris data

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

cell{1,2}

7.2000    3.2000    6.0000    1.8000    3.0000
6.1000    2.6000    5.6000    1.4000    3.0000
6.4000    2.9000    4.3000    1.3000    2.0000
6.8000    3.0000    5.5000    2.1000    3.0000
6.1000    2.8000    4.0000    1.3000    2.0000

Now I am trying to iterate over each of the row and anyalze the data in first column Cell{1,1}, Cell{1,2)… How can I do that? What is the technique to iterate over cell?

  • 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-12T04:53:18+00:00Added an answer on June 12, 2026 at 4:53 am

    Does this cut-down example solve your problem?

    Z = cell(2, 2);
    Z{1, 1} = rand(8, 5); Z{1, 2} = rand(2, 5); 
    Z{2, 1} = rand(8, 5); Z{2, 2} = rand(2, 5);
    X = cell2mat(Z(:, 1));
    XFirstCol = X(:, 1);
    

    I use cell2mat to concatenate all the matrices in the first column of your cell array into one big matrix, and then the last line just grabs the first column of that matrix.

    If you were instead asking how to loop over a cell array, well, you do it the same way as over a numeric array, but using curly braces to index the elements of the cell array ie:

    for i = 1:2
        CurrentCell = Z{i, 1};
        FirstColumnOfCurrentCell = CurrentCell(:, 1);
    end
    

    Or you could combine those two lines into: FirstColumnOfCurrentCell = Z{i, 1}(:, 1);

    A final point, don’t use cell as the name of a variable. This is not good practice, since cell is also the name of an in-built matlab function

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

Sidebar

Related Questions

I manage a website for an organization that has a network where several hundred
I manage a small team of .net developers in what is chiefly a mainframe
python manage.py flush removes data from the entire project. I would like to be
After running the command ./manage.py runserver I'm getting the following error. I know it's
I manage a web application for a client with the following specs: ASP.net 3.5
i manage to get the recordCallBck and deal with the buffer data. now i
I manage the website for a small college library and am trying to create
Currently I'm working on a project of classifying search queries into the following eight
I manage a large asp.net site which has previously been converted from static html
I manage a small group and I'd keep my work breakdown in project. However,

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.